Hi,

First, I am french so sorry for my english errors.
Second, I request you for a big problem with working on very large (about 50mb) jpeg files with GD. In fact, I have to slice them into small 100x100 squares and I did that successfully with 6400x6400 photos (by a PHP script and GD) but I had an error with 21600x21600 photos :
"Unable to allocate 86400 bytes".
I put unlimited memory_limit (locally in php.ini) but it didn't resolve the problem.
I tried ImageMagick too but it didn't want to open my big jpeg.
Does anyone have a solution for that big problem (for me) ? Thanks.

speps.

    Well, you've got to keep in mind that a JPEG is 24 bits per pixel. Since you have a 21600*21600 pixel square, you know there are 466560000 pixels. That's 11197440000 bits total, leaving you with an excess of 11196748800 bits that you cannot allocate.

    So, just increase the memory limit a ton. Also, you'll need to increase the timeout limit, as this will probably take ages.

    What you could do (what I would do, at least), is write a small C binary and shove the image through that. C will give you more speed, which you'll want.

    Check out gd's Web page for some more info on using gd in a C program.

      Thanks.
      I increased the time limit too but that's true a C program could help me a lot and I thought about it yesterday.

      speps.

        Write a Reply...