Wedge

Public area => Bug reports => The Pub => Archived fixes => Topic started by: Nao on April 26th, 2012, 04:39 PM

Title: Error when posting a large image...
Post by: Nao on April 26th, 2012, 04:39 PM
Was testing the attachment handler after rewriting post.js to save another 60+ bytes off it...[1]

Fatal error: Call to undefined function checkGD() in Sources\Subs-Graphics.php on line 203
Call Stack
#   Time   Memory   Function   Location
1   0.0006   827208   {main}( )   ..\index.php:0
2   0.0440   7867680   Post2( )   ..\index.php:198
3   0.0827   14061376   createAttachment( )   ..\Post2.php:683
4   0.0881   14258216   reencodeImage( )   ..\Subs-Post.php:1699

There's a checkGD2() function defined in install.php but that's all. Is this is GD-only function...? If yes, we should use function_exists() on it first...
 1. I should say that I simply turned its methods into private ones, so basically you can't call them from outside (except for checkActive because it's actually used outside), I know it's not something I should do without thinking because one might want to add a prototype for a Wedge object later and they won't be able to access its private variables -- but still, I don't want to put the extra load on everyone when we have no idea whether people will actually want to extend an object... If they do want to, I'll just consider turning the object back into a list of prototypes. Is that okay with you?
Title: Re: Error when posting a large image...
Post by: Arantor on April 26th, 2012, 07:53 PM
Actually, I think I removed checkGD from being present generally because we ensured that GD existed on install and that we didn't really need to check every time thereafter, so the check can thus be removed.
Title: Re: Error when posting a large image...
Post by: Pandos on April 26th, 2012, 08:20 PM
By the way one suggestion...
In Subs-Graphic.php there will be an call for extra memory (48M).
If you have to deal with large pictures AND using GD this is realy not enough.


You'll always get error 500 in all topics with larger images.


Have to mess around with this problem for five days now. Just set this value to 256M and all is working like a charme again.
Title: Re: Error when posting a large image...
Post by: Arantor on April 26th, 2012, 08:49 PM
Actually, SMF already sets the limit to 90M anyway and Wedge did the same, but we also need to make use of ImageMagick if installed...
Title: Re: Error when posting a large image...
Post by: Arantor on April 27th, 2012, 06:50 PM
The original error is fixed in r1565, though the other stuff is not relevant at this debate.