I recently moved hosting of my php mysql site and now when I rin image processing such as watermarks etc I'm getting an error known incorrect sRGB profile. what may have changed? I've taken some of my overlays and resaved them to avoid the issue but I think I would rather know why it is happening?
Provide a screenshot of exact error message that your server returns.
{"code":0,"file":"\/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/image\/Processor.php","line":220,"message":"imagecreatefromstring(): gd-png: libpng warning: iCCP: known incorrect sRGB profile","trace":"#0 [internal function]: exception_error_handler(2, 'imagecreatefrom...', '\/home1\/bmteeute...', 220)\n#1 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/image\/Processor.php(220): imagecreatefromstring('\\x89PNG\\r\\n\\x1A\\n\\x00\\x00\\x00\\rIHD...')\n#2 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/modules\/image.php(173): lib\\image\\Processor->watermark('center', 'bottom', '\/home1\/bmteeute...')\n#3 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(223): modules\\image->watermark(Object(stdClass), '', NULL)\n#4 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(195): lib\\App->execSteps(Object(stdClass))\n#5 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(163): lib\\App->execSteps(Array)\n#6 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/modules\/core.php(102): lib\\App->exec(Object(stdClass), true)\n#7 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(223): modules\\core->condition(Object(stdClass), '', NULL)\n#8 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(195): lib\\App->execSteps(Object(stdClass))\n#9 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(163): lib\\App->execSteps(Array)\n#10 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/modules\/core.php(246): lib\\App->exec(Object(stdClass), true)\n#11 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(223): modules\\core->group(Object(stdClass), 'BotomPASSandRac...', NULL)\n#12 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(195): lib\\App->execSteps(Object(stdClass))\n#13 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(163): lib\\App->execSteps(Array)\n#14 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(152): lib\\App->exec(Object(stdClass), false)\n#15 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnectLib\/lib\/App.php(113): lib\\App->exec(Object(stdClass), false)\n#16 \/home1\/bmteeute\/public_html\/pasprintseries\/dmxConnect\/api\/Data\/Schedule\/EventPhoto.php(7): lib\\App->define(Object(stdClass))\n#17 {main}"}
Does this happen with a specific png file only? What are the server action steps? What version of PHP are you running on the server?
Yes it's only certain png files (usually in watermarks) PHP 8.2 (ea-php82)
I have several conditions that determine which watermark overlay then text
the resulting image is something like this
Do you mean the watermark image is causing the issue, and not the image you're uploading?
This has been the case, yes
The watermarks worked on the old hosting but some don't on the new. I can just go through and re-create them but some of these choose from many watermarks depending on the condition. It just takes time
maybe the php version over here doesn't like them
I am not sure how the warnings should be handled here, maybe @patrick can check this.
any update?
It seems to be some PHP bug that it throws an exception from a warning from the underlying lib it is using. What you can do is suppress the error, in dmxConnectLib/lib/images/Processor.php search for imagecreatefromstring and prepend @ to so that it becomes @imagecreatefromstring.
Oh cool thanks you I will try that
Did you try it, does it work?
I'm sorry, I have just been saving my images without a profile and haven't had a chance
Yesterday everything was working fine and today I got the same error. Changing imagecreatefromstring to @imagecreatefromstring did not help.
UPDATE: this only happens when trying to upload .png file. Uploading .jpg works as expected.
What is the PHP version you are using and does it also throw an error when DEBUG is off?
php 8.2. It gives a 500 error and then tells me to start debugging it.
