DivaVocals:
... The "fix" I posted was based on lhungil's suggestion to make some changes so that some of the error messages that are NOT displaying ("out of memory") will display so we can confirm that this IS what is happening ...
:D Was gonna ask "What fix?", but now I know what you were talking about
Once verified the cause is an "Out of Memory" issue...
It appears (from some quick online searches), imagecreatetruecolor() uses approximately 5bytes per pixel and imagepng() uses approximately 4bytes per pixel. So one possibility would be to check the dimensions of the uploaded images and determine how much memory is needed... Then compare against something like "convertToBytes(ini_get('memory_limit')) - memory_get_usage()" to see if the image will be too high of a resolution to be handled by gd2 in the current environment.
One downside, is there is no simple way to determine from the Zen Cart admin the maximum amount of memory used by a page on the catalog where images will be displayed. This leads to the following two thoughts...
When the maximum memory would be exceeded on the Zen Cart catalog side: display the original image to the end users (or a dummy image). And of course, send an email to the Zen Cart administrative account to report to the admin user(s) the image needs to be replaced with a lower resolution copy (possibly with a calculated max resolution) or contact their hosting provider to increase the amount of memory available to a PHP script.
When the maximum memory would be exceeded on the Zen Cart admin side (or a configured amount of memory would be exceeded): report back to user they need to make the image resolution smaller (possibly with a calculated max resolution) or contact their hosting provider to increase the amount of memory available to a PHP script.
NOTE: Another option for those who may run into this frequently (due to either very large images or lack of memory on shared hosting) would be to use commandline tools such as ImageMagik (if available on the host). Not my favorite method of handling things, but may be a workaround.
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker