Fork me on GitHub

PHP GD Library - wont process images larger than 2,048 pixels  Bottom

  • Hi,

    I have recently released a gallery module (RC1) that allows the user to upload images which are then scaled using GD 2 to generate a thumbnail and large image to the specifications.

    I understand that the PHP memory limit can be a factor, which I've adjusted, but no matter what I set it at, I can't get GD to scale an image larger than 2,048 pixels.

    I have an image function which handles the scaling. It follows this process:
    • It takes the image from the form post
    • determines if the image needs to be scaled (and calculates the new dimensions) and what format should be generated (based on config settings)
    • Then functions -> imagecreatefromjpeg/png(uploaded pic), imagecreatetruecolor(new image dimensions), imagecopyresampled (truecolor from orig image), imagejpeg/png and finally imagedestroy on temp and source image


    Wondering if anyone had any experience with GD that might be able to shed some light?

    --
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • http://forums.devnetwork.net/viewtopic.php?p=240920&sid=d02eedfe51a4efc5f4ab17debab2ec0e

    Might give a clue, I am pretty clueless myself on GD though. ;)


    --
    Zikula Themes
  • Thanks MMaynard... actually I overlooked the fact that I had a a dimension check in the function that was returning false from the image function if greater than X pixels, so it looks like my only limit is the PHP memory... (I had adapted the function from prior use which had the check in there) - DOH!

    Thanks for the forum link. though, as I was looking for a way I might compute if I had enough memory before trying to process the image.

    --
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...

This list is based on users active over the last 60 minutes.