Nao

  • Dadman with a boy
  • Posts: 16,082
Error when posting a large image...
« 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?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Error when posting a large image...
« Reply #1, 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.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Pandos

  • Living on the edge of Wedge
  • Posts: 635
Re: Error when posting a large image...
« Reply #2, 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.
# dpkg-reconfigure brain
error: brain is not installed or configured

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Error when posting a large image...
« Reply #3, 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...