Forums / Cotonti / Bugs / GD bug for newer PHP versions ?

ez
#1 2012-04-12 14:59

Warning: imagecreatefrompng() [function.imagecreatefrompng]: './datas/users/1/img_28032012_233232_1.png' is not a valid PNG file in /www/s/c/h/ttt.nl/public_html/system/functions.php on line 2119
Warning: imagesx() expects parameter 1 to be resource, boolean given in /www/s/c/h/ttt.nl/public_html/system/functions.php on line 2127
Warning: imagesy() expects parameter 1 to be resource, boolean given in /www/s/c/h/ttt.nl/public_html/system/functions.php on line 2128
Warning: Division by zero in /www/s/c/h/ttt.nl/public_html/system/functions.php on line 2138
Warning: imagecopyresampled() expects parameter 2 to be resource, boolean given in /www/s/c/h/ttt.nl/public_html/system/functions.php on line 2159
 

version 0.6.19 cotonti - PHP Version 5.3.10 - GD-version bundled (2.0.34 compatible)

seems thumbnail creation is failing ?????

Does anybody have an idea

 

==- I say: Keep it EZ -==
Trustmaster
#2 2012-04-12 17:13

Is it specific to 5.3.10 or can be found in earlier versions such as 5.3.6?

May the Source be with you!
ez
#3 2012-04-12 17:52

we migrated from 5.3.6 to 5.3.10, so if it is present in earlier version i cannot tell ?

My provider moved me to a different server (newer)

 

Added 13 hours later:

Its unbelievable... but we found the problem !

First: Cotonti was NOT the problem.

But there are a few things we can improve to prevent these messages and make it more clear what is happening.
 

The problem:
We had real strange situations on one of our larger websites (1400+ unique visitors / day). Uploading files was the most visible problem, and generating thumbnails.
 

Cause:
It turns out that our hosting company has a diskQuota (A hard quota). So cot just could NOT write anything to the disk anymore.
This not only means files that ppl upload, but also cachefiles, tmp files and so...
I tell you strange things happen if cache files are filesize 0, and tmp files could not be written.

Improvements we could make:

  • Upload in pfs: after the initial upload somehow check if the uploaded file is valid. ( valid file check ?, not sure how..  )
  • In Cotemplate check if a cached file (tpl cache) is filesize 0. (If its 0, delete that one, and try to regenerate it)
    Anyway if the cachefile size is 0, then DONT use the cache file.
  • Maybe more checks regarding file operations could be made... ?
     

I know this situation was a very rare one, but with a few minor checks here and there and the Cotemplate addition this system will be more solid :) then ever.

hope this will help someone in the future...

 

==- I say: Keep it EZ -==
This post was edited by ez (2012-04-13 08:01, 12 years ago)
GHengeveld
#4 2012-04-14 01:23

Same thing happened to me once too. All of the sudden I got the weirdest errors and the server was super slow. Turned out the server was storing all the email forwarded to my Gmail account and never deleting anything.

ez
#5 2012-04-14 07:31

The additional check for the COTemplate would be nice though... it took me a half hour to figure out why i did not see my regular screens.

I would not go so far to say that its a bug... but its not working properly either.

Addition:

In Cotemplate check if a cached file (tpl cache) is filesize 0. (If its 0, delete that one, and try to regenerate it)
Anyway if the cachefile size is 0, then DONT use the cache file.

its just a simple check... maybe for 0.6.23 and 0.9.9

==- I say: Keep it EZ -==
Trustmaster
#6 2012-04-14 08:25

Yeah, will add this check in 0.9.9 and 0.6.23.

May the Source be with you!
ez
#7 2012-04-14 11:19

thnx...

it is just a minor thing... but it will improve stability

==- I say: Keep it EZ -==