Image Manipulation PHP Class 1.0.4

Friday, October 13, 2006
,

A new version of the Image Manipulation PHP Class has been released. Read further to see what is new in this version of the script.

What's new in this version:

  • a new method was added - crop()
  • a new property was added - preserveSourceFileTime which is by default set to TRUE and which instructs the scripts to preserve the date/time of the source files and pass it on to the target files - thanks patrick from swederland
  • the flip_horizontal and flip_vertical methods were stil using the imagecopy function insetad of using the imagecopyresampled function
  • the create_image_from_source_file() function was incorrectly checking for the existence of the source file: you could specify a valid path (but not a file) and the script would crash error because the path indeed existed even though it was not a file
  • the result of the create_image_from_source_file() private method was poorly implemented and the script could be easily crashed by specifying bogus source files

10 comments:

  1. eastcoastlife said...

    HI!Greetings from Singapore!
    I came to your blog through Blogmad. Nice knowing you.
    Best wishes.

  2. APlennevaux said...

    hi, i'm using your imagetransform class on this site: http://www.dexia-tower.com

    when one downloads an image as a PDF, the source image is first resized, and then cropped using your class.

    it worked fine. but since recently, it first triggers an error message related to the memory

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 10324 bytes) in /var/www/vhosts/dexia-tower.com/httpdocs/_lib/classes/imagetransform/class.imagetransform.php on line 287

    whereas it was working ok before. I don't understand why. Refreshing the page makes it work though, because the script does create the image. So the second time, it does not have to create it, and it can continue to generate the PDF file.

    weird, hu?

  3. APlennevaux said...

    ... further to debugging the error stated in my previous message, i think this class could use some GD checking maybe. It seems the error is caused by the GD library, and the command imagecreatetruecolor which is possibly not supported on my server...

    i continue debugging...

  4. Sukhwinder Singh said...

    Gif transparent image resize doesn't seem to work with php 4.4.x. It did work php 5.1.6 on windows.

  5. Anonymous said...

    In case of transparent images, this scipt doesn't seem to work with php 4.4.x or less. It creates a white background instead of keeping the image transparent.

  6. Stefan Gabos said...

    can it be from the gd version you are using?

  7. Nick said...

    I found an error in 1.0.4 for the two flip functions. It seems copyimageresampled is missing two arguments. Simply repeating the last two again fixes the problem.

    For Vertical it should be:
    imagecopyresampled ($targetImageIdentifier, $sourceImageIdentifier, 0, $y, 0, $sourceImageHeight - $y - 1, $sourceImageWidth, 1, $sourceImageWidth, 1);

    For Horizontal it should be:
    imagecopyresampled($targetImageIdentifier, $sourceImageIdentifier, $x, 0, $sourceImageWidth - $x - 1, 0, 1, $sourceImageHeight, 1, $sourceImageHeight);

  8. Stefan Gabos said...

    you are right. somebody else also reported that and i completely forgot about it. thanks!

  9. Anonymous said...

    I just downloaded the Image Manipulation class, and it works great...on my host server.

    Is there anything I need to do to my local test box (IIS) to get it to work? Right now, all I see is a blank page.

  10. Stefan Gabos said...

    sorry, i never used IIS so i can't tell you what the problem is...

Post a Comment

GlossyBlue Blogger by Black Quanta. Theme & Icons by N.Design Studio
Entries RSS Comments RSS