Challenge with .png graphic uploads - causing error "(An unexpected error occurred: #1414) self.parent.reloadIframe('teaser_graphic_iframe')self.parent.hideModal();"

6 posts by 2 authors in: Forums > CMS Builder
Last Post: March 30, 2022   (RSS)

By Codee - March 25, 2022 - edited: March 28, 2022

Greetings all,

Using CMSB ver 3.55 build 2297. Php 7.4.28.  When I upload .png graphic files I get the error "(An unexpected error occurred: #1414)
self.parent.reloadIframe('teaser_graphic_iframe')self.parent.hideModal();"  -- EVERY TIME.  The image still uploads, though.  This does not happen when I upload a .jpg image.  I am NOT utilizing the webp conversions nor media library.

Screenshot attached. 

Developer log shows " #1417 - E_WARNING: imagecreatefrompng(): gd-png: libpng warning: Interlace handling should be turned on when using png_read_image
/home/airway5/public_html/acPOdmin518/lib/image_functions.php (line 39)
https://airwaycenter.com/acPOdmin518/admin.php"

FYI: If I turn on "WebP" then the error above stops.

Thank you for any assistance.

Attachments:

png-error-uponupload.jpg 102K

By daniel - March 29, 2022

Hi Codee,

Thank you for the report!

I've done some looking into this issue, and couldn't find a conclusive cause. This appears to be an error coming from PHP's image creation library (GD), which may signify something unexpected to do with your particular PHP installation, or the PNG files themselves. If they aren't sensitive, could you attach one of the PNGs that has given you trouble so that I'm able to run some further tests?

Thanks,

Daniel
Technical Lead
interactivetools.com

By daniel - March 30, 2022

Hi Codee,

Thanks for the additional info. A curious issue to be sure - uploading those images to my test environment doesn't produce any errors, so it points to something related to the specific libraries available on the server. Could you test out the following patch for me? In /cmsb/lib/image_functions.php, replace this line (at or around line 42):

case IMAGETYPE_PNG:  $sourceImage = imagecreatefrompng($sourcePath); break;

With this:

case IMAGETYPE_PNG:  $sourceImage = @imagecreatefrompng($sourcePath); break;

This should hopefully silence the error. As the image still uploads correctly, that may be sufficient.

Thanks,
Daniel

Daniel
Technical Lead
interactivetools.com

By Codee - March 30, 2022

done. Thanks, Daniel. I noticed the .jpg was already set to suppress jpeg errors. Is that how the core file is supposed to be set?

By daniel - March 30, 2022

Hi Codee,

Yes - it appears there was a similar issue that came up related to uploading invalid JPEGs. We prefer to resolve error messages without silencing them, but sometimes it is unavoidable!

Daniel
Technical Lead
interactivetools.com