[SOLVED] Error: Unable to open image /chroot/tmp/... on change canvas.

8 years 10 months ago - 8 years 10 months ago #265973 by NicoFaaij
Hi,

I am using the latest software levels.

When we try to change the canvas in a user profile we get a error message:

Fout
Canvas afbeelding : Unable to open image /chroot/tmp/phptnCtJU

It happens in front-end and back-end.

Any idea what went wrong and how to fix it?

Thanks in advance and with kind regards,
Nico

Please Log in to join the conversation.

8 years 10 months ago #265974 by krileon
Sounds like PHP tmp folder permissions are not set correctly so the image is unable to be moved/opened as needed. When a file uploads it's sent to PHP tmp. It's then moved, copied, opened & saved, etc.. from there. In the case of image fields the file is opened, processed, and saved to its destination. You should have this issue for all image uploads and maybe even file uploads. You'll need to contact your host or try using FTP to change the folders permissions.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

8 years 10 months ago - 8 years 10 months ago #265977 by NicoFaaij
That all looks all right and if that was the issue I think I had some more errors on this environment.

I think the software calls a wrong directory as I don't know a directory named /chroot.

Do you know where /chroot in front of the /tmp directory is comming from? It sounds like changeroot.

Please Log in to join the conversation.

8 years 10 months ago #265981 by NicoFaaij
When I try to upload this image in the default joomla image manager, or another component than nothing went wrong. When I try to upload another picture as canvas it also works fine.

So it seems to be the combination of a particular picture and CB - canvas.

The picture is is with 640x210 and 393kB within the set marges.

Any idea why a picture like that can be rejected at CB - Canvas upload?

Please Log in to join the conversation.

8 years 10 months ago #265984 by krileon
Could be modsecurity rejecting it for whatever reason. Check server error logs to see if there's any further details. Be sure to test with debug mode and maximum error reporting enabled so further error information can be output.

This is normally caused by the PHP user not having write permission to tmp. The error is basically saying GD or ImageMagick (whichever you're using) is unable to open the _FILES that was just uploaded. So it can't open, process, then save it in its new destination like it needs to. Why this only affects 1 file doesn't make any sense unless modsecurity is stopping it or the file is corrupt and GD/ImageMagick is failing to open it due to corruption.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: NicoFaaij

Please Log in to join the conversation.

8 years 10 months ago #265986 by NicoFaaij
There must be something wrong with the image I got form a end-user. I could also not open it in my favorite Pixlr.com image editor.

But I could open it in the default simple Windows Paint program and save it with a different name as a jpg. And then it works.

So I think you where right, it had to do something with GD/ImageMagick failing to open this image which looked normal in filemanager and browsers like Explorer and Chrome. Saving it again as jpg, before cancas upload, did solve the case.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.426 seconds

Facebook Twitter LinkedIn