SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,318
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    2 gd image Qs: in the same script? why bad quality?

    just learning gd image stuff

    i've written a script that joins 2 images together to create one image file. and that's fine, but it seems that you're supposed to create a single php file that is used just to create the image. then from another php file call that php image script up when the image is needed.

    is it possible to have the image making script in the main php script? - then i'd be able to create an image based on variables gathered from earlier parts of that script


    also..

    why has the quality gone down hill significantly?

    my script joins 2 pngs together by creating a new image with imagecreate then copying the 2 original pngs into it using imagecopy - the origninal pngs and the new joined one are here. why such quality loss and is that possible rectify?

    thanks

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No GD has always been an inferior product. I never use GD, I prefer to use these two.

    imagemagick
    http://sourceforge.net/projects/imagemagick/

    netPBM
    http://sourceforge.net/projects/netpbm/
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,318
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    what no to both questions?!
    surely there's a way to communicate variables from main script to image creation scipt?

  4. #4
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Johhnyboy - I think you are supposed to use two seperate files for creating the images because of redeclaring the headers.. but then I am only just starting to learn this myself you can pull in the variables you want to use by using
    Code:
    <img src="image.php?did=123&cid=456" height="100" width="10" >"
    then all you will need is one image.php file which creates the actual image itself and then its displayed in your main page.


    (what tuts did you find useful?)
    Regular user

  5. #5
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,318
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    really?! is that how you're supposed to do it? that is terrable. good grief. i really thought they'd be a better way to do it than that. right well, i'll give that a go. thanks.

    i'm not really following any tutorials - i'm just sticking bits together that's in the manual - i'm not really trying to do anything that complicated with the actual gd part - just join several images together - that's it. the info i want to pass to the gd part is which images to put together.

    i did read the one on webmonkey a some time while ago and that seemed ok
    http://hotwired.lycos.com/webmonkey/...ex4a_meta.html


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •