Professional Web Applications Themes

#39780 [NEW]: Fatal error reported for recoverable error - PHP Bugs

From: pz at mysqlperformanceblog dot com Operating system: Linux PHP version: 5.2.0 PHP Bug Type: GD related Bug description: Fatal error reported for recoverable error Description: ------------ Getting the following error: PHP Fatal error: imagecreatefromstring(): gd-png: fatal libpng error: IDAT: CRC error in Note this is FATAL error for what should have been simply false result code from the function. Reproduce code: --------------- imagecreatefromstring(file_get_contents("http://www.bennygold.com/uploaded_images/crack_line1-793571.gif")); Expected result: ---------------- FALSE returned from the function with warning printed Actual result: -------------- Script is terminated with fatal error -- Edit bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url] -- Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=39780&r=trysnapshot44[/url] Try a ...

  1. #1

    Default #39780 [NEW]: Fatal error reported for recoverable error

    From: pz at mysqlperformanceblog dot com
    Operating system: Linux
    PHP version: 5.2.0
    PHP Bug Type: GD related
    Bug description: Fatal error reported for recoverable error

    Description:
    ------------
    Getting the following error:

    PHP Fatal error: imagecreatefromstring(): gd-png: fatal libpng error:
    IDAT: CRC error in

    Note this is FATAL error for what should have been simply false result
    code from the function.

    Reproduce code:
    ---------------
    imagecreatefromstring(file_get_contents("http://www.bennygold.com/uploaded_images/crack_line1-793571.gif"));



    Expected result:
    ----------------
    FALSE returned from the function with warning printed

    Actual result:
    --------------
    Script is terminated with fatal error

    --
    Edit bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=39780&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=39780&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=39780&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=39780&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=39780&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=39780&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=39780&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=39780&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=39780&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=39780&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=39780&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=39780&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=39780&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=39780&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=39780&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=39780&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=39780&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=39780&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=39780&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=39780&r=mysqlcfg[/url]
    pz at mysqlperformanceblog dot com Guest

  2. #2

    Default #39780 [Opn->Asn]: Fatal error reported for recoverable error

    ID: 39780
    Updated by: [email]tony2001php.net[/email]
    Reported By: pz at mysqlperformanceblog dot com
    -Status: Open
    +Status: Assigned
    Bug Type: GD related
    Operating System: Linux
    PHP Version: 5.2.0
    -Assigned To:
    +Assigned To: pajoye
    New Comment:

    Pierre, is E_ERROR really required in this case?


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-08 18:25:56] pz at mysqlperformanceblog dot com

    Description:
    ------------
    Getting the following error:

    PHP Fatal error: imagecreatefromstring(): gd-png: fatal libpng error:
    IDAT: CRC error in

    Note this is FATAL error for what should have been simply false result
    code from the function.

    Reproduce code:
    ---------------
    imagecreatefromstring(file_get_contents("http://www.bennygold.com/uploaded_images/crack_line1-793571.gif"));



    Expected result:
    ----------------
    FALSE returned from the function with warning printed

    Actual result:
    --------------
    Script is terminated with fatal error


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    tony2001@php.net Guest

  3. #3

    Default #39780 [Asn->Fbk]: Fatal error reported for recoverable error

    ID: 39780
    Updated by: [email]iliaaphp.net[/email]
    Reported By: pz at mysqlperformanceblog dot com
    -Status: Assigned
    +Status: Feedback
    Bug Type: GD related
    Operating System: Linux
    PHP Version: 5.2.0
    Assigned To: pajoye
    New Comment:

    You really should be using the imagecreatefromgif() function
    in this instance. The URL with an image seems to be down, can
    you provide a working URL for the file please.


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-08 18:33:46] [email]tony2001php.net[/email]

    Pierre, is E_ERROR really required in this case?

    ------------------------------------------------------------------------

    [2006-12-08 18:25:56] pz at mysqlperformanceblog dot com

    Description:
    ------------
    Getting the following error:

    PHP Fatal error: imagecreatefromstring(): gd-png: fatal libpng error:
    IDAT: CRC error in

    Note this is FATAL error for what should have been simply false result
    code from the function.

    Reproduce code:
    ---------------
    imagecreatefromstring(file_get_contents("http://www.bennygold.com/uploaded_images/crack_line1-793571.gif"));



    Expected result:
    ----------------
    FALSE returned from the function with warning printed

    Actual result:
    --------------
    Script is terminated with fatal error


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    iliaa@php.net Guest

  4. #4

    Default #39780 [Fbk]: Fatal error reported for recoverable error

    ID: 39780
    Updated by: [email]pajoyephp.net[/email]
    Reported By: pz at mysqlperformanceblog dot com
    Status: Feedback
    Bug Type: GD related
    Operating System: Linux
    PHP Version: 5.2.0
    Assigned To: pajoye
    New Comment:

    Please provide a working link to the image.


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-08 20:02:21] [email]iliaaphp.net[/email]

    You really should be using the imagecreatefromgif() function
    in this instance. The URL with an image seems to be down, can
    you provide a working URL for the file please.

    ------------------------------------------------------------------------

    [2006-12-08 18:33:46] [email]tony2001php.net[/email]

    Pierre, is E_ERROR really required in this case?

    ------------------------------------------------------------------------

    [2006-12-08 18:25:56] pz at mysqlperformanceblog dot com

    Description:
    ------------
    Getting the following error:

    PHP Fatal error: imagecreatefromstring(): gd-png: fatal libpng error:
    IDAT: CRC error in

    Note this is FATAL error for what should have been simply false result
    code from the function.

    Reproduce code:
    ---------------
    imagecreatefromstring(file_get_contents("http://www.bennygold.com/uploaded_images/crack_line1-793571.gif"));



    Expected result:
    ----------------
    FALSE returned from the function with warning printed

    Actual result:
    --------------
    Script is terminated with fatal error


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    pajoye@php.net Guest

  5. #5

    Default #39780 [Fbk->Opn]: Fatal error reported for recoverable error

    ID: 39780
    User updated by: pz at mysqlperformanceblog dot com
    Reported By: pz at mysqlperformanceblog dot com
    -Status: Feedback
    +Status: Open
    Bug Type: GD related
    Operating System: Linux
    PHP Version: 5.2.0
    Assigned To: pajoye
    New Comment:

    Here is the copy of the image:

    [url]http://www.mysqlperformanceblog.com/files/misc/1.gif[/url]

    It is actually PNG image even if it has gif extension.

    Regarding what function I should use this is not the point - I created
    simple test case to illustrate problem. In the real script it is used
    completely different way.


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-08 20:02:35] [email]pajoyephp.net[/email]

    Please provide a working link to the image.

    ------------------------------------------------------------------------

    [2006-12-08 20:02:21] [email]iliaaphp.net[/email]

    You really should be using the imagecreatefromgif() function
    in this instance. The URL with an image seems to be down, can
    you provide a working URL for the file please.

    ------------------------------------------------------------------------

    [2006-12-08 18:33:46] [email]tony2001php.net[/email]

    Pierre, is E_ERROR really required in this case?

    ------------------------------------------------------------------------

    [2006-12-08 18:25:56] pz at mysqlperformanceblog dot com

    Description:
    ------------
    Getting the following error:

    PHP Fatal error: imagecreatefromstring(): gd-png: fatal libpng error:
    IDAT: CRC error in

    Note this is FATAL error for what should have been simply false result
    code from the function.

    Reproduce code:
    ---------------
    imagecreatefromstring(file_get_contents("http://www.bennygold.com/uploaded_images/crack_line1-793571.gif"));



    Expected result:
    ----------------
    FALSE returned from the function with warning printed

    Actual result:
    --------------
    Script is terminated with fatal error


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    pz at mysqlperformanceblog dot com Guest

  6. #6

    Default #39780 [Opn->Ana]: Fatal error reported for recoverable error

    ID: 39780
    Updated by: [email]pajoyephp.net[/email]
    Reported By: pz at mysqlperformanceblog dot com
    -Status: Open
    +Status: yzed
    Bug Type: GD related
    Operating System: Linux
    PHP Version: 5.2.0
    Assigned To: pajoye
    New Comment:

    The image is invalid. Either the buffer is incomplete or the CRC is
    wrong. You can try with different image viewers, the lower part will
    miss, more or less depending on how tolerant is the reader.

    It is also important to tell us directly what you provide, like a png
    named as gif, it minimizes the time we need to test or yze your
    problem. If you used imagecreatefromgif it will simply fail, so yes,
    which functions you use to open this image is important.

    I will check if returning false is a safe choice. It should be but I
    need to test it first.




    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-08 20:17:42] pz at mysqlperformanceblog dot com

    Here is the copy of the image:

    [url]http://www.mysqlperformanceblog.com/files/misc/1.gif[/url]

    It is actually PNG image even if it has gif extension.

    Regarding what function I should use this is not the point - I created
    simple test case to illustrate problem. In the real script it is used
    completely different way.

    ------------------------------------------------------------------------

    [2006-12-08 20:02:35] [email]pajoyephp.net[/email]

    Please provide a working link to the image.

    ------------------------------------------------------------------------

    [2006-12-08 20:02:21] [email]iliaaphp.net[/email]

    You really should be using the imagecreatefromgif() function
    in this instance. The URL with an image seems to be down, can
    you provide a working URL for the file please.

    ------------------------------------------------------------------------

    [2006-12-08 18:33:46] [email]tony2001php.net[/email]

    Pierre, is E_ERROR really required in this case?

    ------------------------------------------------------------------------

    [2006-12-08 18:25:56] pz at mysqlperformanceblog dot com

    Description:
    ------------
    Getting the following error:

    PHP Fatal error: imagecreatefromstring(): gd-png: fatal libpng error:
    IDAT: CRC error in

    Note this is FATAL error for what should have been simply false result
    code from the function.

    Reproduce code:
    ---------------
    imagecreatefromstring(file_get_contents("http://www.bennygold.com/uploaded_images/crack_line1-793571.gif"));



    Expected result:
    ----------------
    FALSE returned from the function with warning printed

    Actual result:
    --------------
    Script is terminated with fatal error


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    pajoye@php.net Guest

  7. #7

    Default #39780 [Ana]: Fatal error reported for recoverable error

    ID: 39780
    User updated by: pz at mysqlperformanceblog dot com
    Reported By: pz at mysqlperformanceblog dot com
    Status: yzed
    Bug Type: GD related
    Operating System: Linux
    PHP Version: 5.2.0
    Assigned To: pajoye
    New Comment:

    Sure image is invalid. This is not the point.

    The function is specified as it ether returns image or FALSE on error.
    If it also can in case of error terminate script execution or format
    the hard drive it is better to be specified in docs :)

    Now regarding what I provide - the name of the file does not matter in
    this case as image is created from memory buffer. I just gave you the
    real image on which my thumbnail generation script failed.

    Out of few millions of images processed many were malformed etc but in
    most cases PHP handles it correctly by reporting FALSE and printing
    appropriate warning. So at least this behavior is inconsistent.


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-08 21:47:30] [email]pajoyephp.net[/email]

    The image is invalid. Either the buffer is incomplete or the CRC is
    wrong. You can try with different image viewers, the lower part will
    miss, more or less depending on how tolerant is the reader.

    It is also important to tell us directly what you provide, like a png
    named as gif, it minimizes the time we need to test or yze your
    problem. If you used imagecreatefromgif it will simply fail, so yes,
    which functions you use to open this image is important.

    I will check if returning false is a safe choice. It should be but I
    need to test it first.



    ------------------------------------------------------------------------

    [2006-12-08 20:17:42] pz at mysqlperformanceblog dot com

    Here is the copy of the image:

    [url]http://www.mysqlperformanceblog.com/files/misc/1.gif[/url]

    It is actually PNG image even if it has gif extension.

    Regarding what function I should use this is not the point - I created
    simple test case to illustrate problem. In the real script it is used
    completely different way.

    ------------------------------------------------------------------------

    [2006-12-08 20:02:35] [email]pajoyephp.net[/email]

    Please provide a working link to the image.

    ------------------------------------------------------------------------

    [2006-12-08 20:02:21] [email]iliaaphp.net[/email]

    You really should be using the imagecreatefromgif() function
    in this instance. The URL with an image seems to be down, can
    you provide a working URL for the file please.

    ------------------------------------------------------------------------

    [2006-12-08 18:33:46] [email]tony2001php.net[/email]

    Pierre, is E_ERROR really required in this case?

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/39780[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    pz at mysqlperformanceblog dot com Guest

  8. #8

    Default #39780 [Ana]: Fatal error reported for recoverable error

    ID: 39780
    Updated by: [email]pajoyephp.net[/email]
    Reported By: pz at mysqlperformanceblog dot com
    Status: yzed
    Bug Type: GD related
    Operating System: Linux
    PHP Version: 5.2.0
    Assigned To: pajoye
    New Comment:

    "Sure image is invalid. This is not the point. "

    My point is to have the relelevant informations in the report instead
    of letting us wondering what you are trying to do or achieve. And it is
    a valid requirement.

    "The function is specified as it ether returns image or FALSE on
    error."

    As I just said, I have to test further to see if it is safe to continue
    the script execution.


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-09 09:59:47] pz at mysqlperformanceblog dot com

    Sure image is invalid. This is not the point.

    The function is specified as it ether returns image or FALSE on error.
    If it also can in case of error terminate script execution or format
    the hard drive it is better to be specified in docs :)

    Now regarding what I provide - the name of the file does not matter in
    this case as image is created from memory buffer. I just gave you the
    real image on which my thumbnail generation script failed.

    Out of few millions of images processed many were malformed etc but in
    most cases PHP handles it correctly by reporting FALSE and printing
    appropriate warning. So at least this behavior is inconsistent.

    ------------------------------------------------------------------------

    [2006-12-08 21:47:30] [email]pajoyephp.net[/email]

    The image is invalid. Either the buffer is incomplete or the CRC is
    wrong. You can try with different image viewers, the lower part will
    miss, more or less depending on how tolerant is the reader.

    It is also important to tell us directly what you provide, like a png
    named as gif, it minimizes the time we need to test or yze your
    problem. If you used imagecreatefromgif it will simply fail, so yes,
    which functions you use to open this image is important.

    I will check if returning false is a safe choice. It should be but I
    need to test it first.



    ------------------------------------------------------------------------

    [2006-12-08 20:17:42] pz at mysqlperformanceblog dot com

    Here is the copy of the image:

    [url]http://www.mysqlperformanceblog.com/files/misc/1.gif[/url]

    It is actually PNG image even if it has gif extension.

    Regarding what function I should use this is not the point - I created
    simple test case to illustrate problem. In the real script it is used
    completely different way.

    ------------------------------------------------------------------------

    [2006-12-08 20:02:35] [email]pajoyephp.net[/email]

    Please provide a working link to the image.

    ------------------------------------------------------------------------

    [2006-12-08 20:02:21] [email]iliaaphp.net[/email]

    You really should be using the imagecreatefromgif() function
    in this instance. The URL with an image seems to be down, can
    you provide a working URL for the file please.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/39780[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    pajoye@php.net Guest

  9. #9

    Default #39780 [Ana]: Fatal error reported for recoverable error

    ID: 39780
    Updated by: [email]pajoyephp.net[/email]
    Reported By: pz at mysqlperformanceblog dot com
    Status: yzed
    Bug Type: GD related
    Operating System: Linux
    PHP Version: 5.2.0
    Assigned To: pajoye
    New Comment:

    Ok, I found the problem.

    It requires to add more jmp points in the png implementation. We have
    only one now, forcing us to bail out immediately if an error occurred
    after the image initialization (when the png headers are correct but
    not the data/CRC).

    I'm not sure if I can make it for 5.2.x but 6.x will return false.


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-09 11:09:57] [email]pajoyephp.net[/email]

    "Sure image is invalid. This is not the point. "

    My point is to have the relelevant informations in the report instead
    of letting us wondering what you are trying to do or achieve. And it is
    a valid requirement.

    "The function is specified as it ether returns image or FALSE on
    error."

    As I just said, I have to test further to see if it is safe to continue
    the script execution.

    ------------------------------------------------------------------------

    [2006-12-09 09:59:47] pz at mysqlperformanceblog dot com

    Sure image is invalid. This is not the point.

    The function is specified as it ether returns image or FALSE on error.
    If it also can in case of error terminate script execution or format
    the hard drive it is better to be specified in docs :)

    Now regarding what I provide - the name of the file does not matter in
    this case as image is created from memory buffer. I just gave you the
    real image on which my thumbnail generation script failed.

    Out of few millions of images processed many were malformed etc but in
    most cases PHP handles it correctly by reporting FALSE and printing
    appropriate warning. So at least this behavior is inconsistent.

    ------------------------------------------------------------------------

    [2006-12-08 21:47:30] [email]pajoyephp.net[/email]

    The image is invalid. Either the buffer is incomplete or the CRC is
    wrong. You can try with different image viewers, the lower part will
    miss, more or less depending on how tolerant is the reader.

    It is also important to tell us directly what you provide, like a png
    named as gif, it minimizes the time we need to test or yze your
    problem. If you used imagecreatefromgif it will simply fail, so yes,
    which functions you use to open this image is important.

    I will check if returning false is a safe choice. It should be but I
    need to test it first.



    ------------------------------------------------------------------------

    [2006-12-08 20:17:42] pz at mysqlperformanceblog dot com

    Here is the copy of the image:

    [url]http://www.mysqlperformanceblog.com/files/misc/1.gif[/url]

    It is actually PNG image even if it has gif extension.

    Regarding what function I should use this is not the point - I created
    simple test case to illustrate problem. In the real script it is used
    completely different way.

    ------------------------------------------------------------------------

    [2006-12-08 20:02:35] [email]pajoyephp.net[/email]

    Please provide a working link to the image.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/39780[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    pajoye@php.net Guest

  10. #10

    Default #39780 [Ana->Fbk]: Fatal error reported for recoverable error

    ID: 39780
    Updated by: [email]pajoyephp.net[/email]
    Reported By: pz at mysqlperformanceblog dot com
    -Status: yzed
    +Status: Feedback
    Bug Type: GD related
    Operating System: Linux
    PHP Version: 5.2.0
    Assigned To: pajoye
    New Comment:

    Please try with this patch (against 5.2 cvs):

    [url]http://pecl.php.net/~pierre/gdphpbug39780.txt[/url]

    It raises (yes many ;) warnings instead of fatal errors.

    Ilia, is it ok for 5.2?


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-09 11:59:59] [email]pajoyephp.net[/email]

    Ok, I found the problem.

    It requires to add more jmp points in the png implementation. We have
    only one now, forcing us to bail out immediately if an error occurred
    after the image initialization (when the png headers are correct but
    not the data/CRC).

    I'm not sure if I can make it for 5.2.x but 6.x will return false.

    ------------------------------------------------------------------------

    [2006-12-09 11:09:57] [email]pajoyephp.net[/email]

    "Sure image is invalid. This is not the point. "

    My point is to have the relelevant informations in the report instead
    of letting us wondering what you are trying to do or achieve. And it is
    a valid requirement.

    "The function is specified as it ether returns image or FALSE on
    error."

    As I just said, I have to test further to see if it is safe to continue
    the script execution.

    ------------------------------------------------------------------------

    [2006-12-09 09:59:47] pz at mysqlperformanceblog dot com

    Sure image is invalid. This is not the point.

    The function is specified as it ether returns image or FALSE on error.
    If it also can in case of error terminate script execution or format
    the hard drive it is better to be specified in docs :)

    Now regarding what I provide - the name of the file does not matter in
    this case as image is created from memory buffer. I just gave you the
    real image on which my thumbnail generation script failed.

    Out of few millions of images processed many were malformed etc but in
    most cases PHP handles it correctly by reporting FALSE and printing
    appropriate warning. So at least this behavior is inconsistent.

    ------------------------------------------------------------------------

    [2006-12-08 21:47:30] [email]pajoyephp.net[/email]

    The image is invalid. Either the buffer is incomplete or the CRC is
    wrong. You can try with different image viewers, the lower part will
    miss, more or less depending on how tolerant is the reader.

    It is also important to tell us directly what you provide, like a png
    named as gif, it minimizes the time we need to test or yze your
    problem. If you used imagecreatefromgif it will simply fail, so yes,
    which functions you use to open this image is important.

    I will check if returning false is a safe choice. It should be but I
    need to test it first.



    ------------------------------------------------------------------------

    [2006-12-08 20:17:42] pz at mysqlperformanceblog dot com

    Here is the copy of the image:

    [url]http://www.mysqlperformanceblog.com/files/misc/1.gif[/url]

    It is actually PNG image even if it has gif extension.

    Regarding what function I should use this is not the point - I created
    simple test case to illustrate problem. In the real script it is used
    completely different way.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/39780[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    pajoye@php.net Guest

  11. #11

    Default #39780 [Fbk->Csd]: Fatal error reported for recoverable error

    ID: 39780
    Updated by: [email]pajoyephp.net[/email]
    Reported By: pz at mysqlperformanceblog dot com
    -Status: Feedback
    +Status: Closed
    Bug Type: GD related
    Operating System: Linux
    PHP Version: 5.2.0
    Assigned To: pajoye
    New Comment:

    This bug has been fixed in CVS.

    Snapshots of the sources are packaged every three hours; this change
    will be in the next snapshot. You can grab the snapshot at
    [url]http://snaps.php.net/[/url].

    Thank you for the report, and for helping us make PHP better.




    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-09 12:05:48] [email]pajoyephp.net[/email]

    Please try with this patch (against 5.2 cvs):

    [url]http://pecl.php.net/~pierre/gdphpbug39780.txt[/url]

    It raises (yes many ;) warnings instead of fatal errors.

    Ilia, is it ok for 5.2?

    ------------------------------------------------------------------------

    [2006-12-09 11:59:59] [email]pajoyephp.net[/email]

    Ok, I found the problem.

    It requires to add more jmp points in the png implementation. We have
    only one now, forcing us to bail out immediately if an error occurred
    after the image initialization (when the png headers are correct but
    not the data/CRC).

    I'm not sure if I can make it for 5.2.x but 6.x will return false.

    ------------------------------------------------------------------------

    [2006-12-09 11:09:57] [email]pajoyephp.net[/email]

    "Sure image is invalid. This is not the point. "

    My point is to have the relelevant informations in the report instead
    of letting us wondering what you are trying to do or achieve. And it is
    a valid requirement.

    "The function is specified as it ether returns image or FALSE on
    error."

    As I just said, I have to test further to see if it is safe to continue
    the script execution.

    ------------------------------------------------------------------------

    [2006-12-09 09:59:47] pz at mysqlperformanceblog dot com

    Sure image is invalid. This is not the point.

    The function is specified as it ether returns image or FALSE on error.
    If it also can in case of error terminate script execution or format
    the hard drive it is better to be specified in docs :)

    Now regarding what I provide - the name of the file does not matter in
    this case as image is created from memory buffer. I just gave you the
    real image on which my thumbnail generation script failed.

    Out of few millions of images processed many were malformed etc but in
    most cases PHP handles it correctly by reporting FALSE and printing
    appropriate warning. So at least this behavior is inconsistent.

    ------------------------------------------------------------------------

    [2006-12-08 21:47:30] [email]pajoyephp.net[/email]

    The image is invalid. Either the buffer is incomplete or the CRC is
    wrong. You can try with different image viewers, the lower part will
    miss, more or less depending on how tolerant is the reader.

    It is also important to tell us directly what you provide, like a png
    named as gif, it minimizes the time we need to test or yze your
    problem. If you used imagecreatefromgif it will simply fail, so yes,
    which functions you use to open this image is important.

    I will check if returning false is a safe choice. It should be but I
    need to test it first.



    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/39780[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=39780&edit=1[/url]
    pajoye@php.net Guest

Similar Threads

  1. The user Directory publishing service reported an error
    By jehrbear in forum Macromedia Contribute Connection Administrtion
    Replies: 3
    Last Post: July 15th, 05:55 AM
  2. Replies: 2
    Last Post: February 21st, 11:20 PM
  3. Fireworks reported an I O error.
    By introubleagain in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 0
    Last Post: August 3rd, 03:57 AM
  4. #9719 [Com]: Dash in URL causing CGI Error to be reported
    By porantim at hotmail dot com in forum PHP Development
    Replies: 0
    Last Post: September 1st, 05:50 PM
  5. Replies: 0
    Last Post: August 5th, 12:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139