ilab-media-tools
ilab-media-tools copied to clipboard
Error when cropping an image
I upload the image, then try to crop it with your tool and i get an error where:
It doesn't happend everytime, but with one image, 80% of the time happens and i don't know why.
Image is:
Steps to reproduce the behavior:
- Upload an image
- Click on crop image
- Select the area to crop
- Click on Crop Image
- All looks ok, except for the current thumbnail image at the top right corner where it looks like 404. (First Image uploaded )
Expected behavior I expected to work and crop the image
Screenshots
Server (please complete the following information)
- Operating System ubuntu
- PHP Version 8.2.15
- Using PHP-FPM? no
- Using WordPress Cron? yes
How did you install the plugin? Wordpress
Are you using imgix? What cloud storage provider? Have you enabled Debugging in Media Cloud features and then looked at the debug log? Which version of the plugin are you using? Free or premium?
On Mar 26, 2024, at 10:32 PM, Matias Berger @.***> wrote:
I upload the image, then try to crop it with your tool and i get an error where: image.png (view on web) https://github.com/Interfacelab/ilab-media-tools/assets/105875318/a9245021-b166-47e8-a7bc-09f50f73a270 It doesn't happend everytime, but with one image, 80% of the time happens and i don't know why. Image is: soldier-test-3.jpg (view on web) https://github.com/Interfacelab/ilab-media-tools/assets/105875318/f4d9a6a9-ae47-4089-b53a-ef90ad294d21 Steps to reproduce the behavior:
Upload an image Click on crop image Select the area to crop Click on Crop Image All looks ok, except for the current thumbnail image at the top right corner where it looks like 404. (First Image uploaded ) Expected behavior I expected to work and crop the image
Screenshots image.png (view on web) https://github.com/Interfacelab/ilab-media-tools/assets/105875318/6e38ea6f-c199-45bc-a72f-778ccfbf8da7 Server (please complete the following information)
Operating System ubuntu PHP Version 8.2.15 Using PHP-FPM? no Using WordPress Cron? yes How did you install the plugin? Wordpress
— Reply to this email directly, view it on GitHub https://github.com/Interfacelab/ilab-media-tools/issues/231, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAK3ILKKXM7XHNYGHO3FFLY2GIJVAVCNFSM6AAAAABFJFO2EWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYDQNJZGA3TMMA. You are receiving this because you are subscribed to this thread.
Working fine here.
Storage provider : amazon s3 imgix: Yes Free version version: 4.6.2
For debugging: [26-Mar-2024 16:01:29 UTC] PHP Warning: Trying to access array offset on value of type bool in /var/www/html/wp-content/plugins/ilab-media-tools/classes/Tools/Crop/CropTool.php on line 265 only that in the server
And in the web console, i get sometimes:
ilab-media-tools.js?ver=4.6.2:1 Uncaught TypeError: Cannot read properties of undefined (reading 'get')
at window.ILabCrop.
Open up CropTool.php and change the line (line #204) in the function displayCropUI()
from:
$meta = wp_get_attachment_metadata($image_id);
To:
$meta = wp_get_attachment_metadata($image_id);
if (!is_array($meta)) {
Logger::error("{$image_id} doesn't have metadata.");
return;
}
Save the file and try the crop again. Check the debug log (WordPress Admin -> Media Cloud -> Debug Log) after and look for "doesn't have metadata" in the log. Let me know if it's there.
Now i didn't get that error. So i enable the info log and here are the logs from when i click to crop the image, after it finishes.
media-cloud-log (1).csv
I don't see any errors, but the result is:
You are using imgix? Why are you using image optimization if you are using imgix?
On Mar 26, 2024, at 11:28 PM, Matias Berger @.***> wrote:
Now i didn't get that error. So i enable the info log and here are the logs from when i click to crop the image, after it finishes. media-cloud-log (1).csv https://github.com/Interfacelab/ilab-media-tools/files/14761623/media-cloud-log.1.csv I don't see any errors, but the result is: image.png (view on web) https://github.com/Interfacelab/ilab-media-tools/assets/105875318/92b27e66-8466-47ad-839f-8f67609c5352 — Reply to this email directly, view it on GitHub https://github.com/Interfacelab/ilab-media-tools/issues/231#issuecomment-2020910205, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAK3IMML6ASZXK2HVBLLLDY2GOZHAVCNFSM6AAAAABFJFO2EWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRQHEYTAMRQGU. You are receiving this because you commented.
Yes I'm using imgix, where can i disable the image optimization? is that from this plugin? Because i don't see any other plugin for that, unless I'm overseeing something.
You are going to have to send me an admin login: @.*** @.***>
I need to see what you are working with and I don't have time to go back and forth on github issues.
Thanks,
Jon.
On Mar 26, 2024, at 11:38 PM, Matias Berger @.***> wrote:
Yes I'm using imgix, where can i disable the image optimization? is that from this plugin? Because i don't see any other plugin for that, unless I'm overseeing something.
— Reply to this email directly, view it on GitHub https://github.com/Interfacelab/ilab-media-tools/issues/231#issuecomment-2020942555, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAK3IIWXD4J2BCDGNLWB7DY2GP7FAVCNFSM6AAAAABFJFO2EWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRQHE2DENJVGU. You are receiving this because you commented.
First of all, thanks for your help! I've been trying to debug it and understand the issue without reaching anything. if you want and can, we can make a quick call. Sorry for the inconvenience. Also, something to add is , the system returns an url for the image, but that url returns 404. So i don't know if it's a problem from imgix.