ImagePlus icon indicating copy to clipboard operation
ImagePlus copied to clipboard

Latest versions not working with AWS media source

Open matdave opened this issue 3 years ago • 4 comments

Upgrading from 2.8.5 to 2.9.1 caused it to stop working with AWS media sources. When I select the image from an AWS Source it says image could not be found. It looks like it is trying to read the path and not the full URL.

matdave avatar Jul 27 '22 14:07 matdave

I currently have no external media source available. This code tries to get the image size with img.onload, since the MODX way has issues with images larger than 800x600. With 2.9.1 I did not use the MODX way anymore and switched to the img.onload: https://github.com/Jako/ImagePlus/blob/2d7dfadb42519a11f9dfcd3079e5204f53eceaff/source/js/mgr/imageplus.panel.input.js#L311-L363.

There has to be some switch for external media sources.

Jako avatar Jul 27 '22 22:07 Jako

Ah, on external media i stopped grabbing the image dimensions with the media source because it's huge request killer when there are more than a handful of files in a folder.

matdave avatar Aug 02 '22 19:08 matdave

nevermind, i left the fake 400x300 value in there so it's not missing entirely https://github.com/modxcms/aws-s3-media-source/blob/6a0d42265a66d30a05b698a2a65decb03df696cc/core/components/awss3mediasource/model/awss3mediasource/awss3mediasource.class.php#L471

matdave avatar Aug 02 '22 19:08 matdave

The issue is the onload requirement. An external media source has to retrieve the image different. If you are able to send me some code loading the image from an exernal media source I will be very happy.

Jako avatar Aug 07 '22 23:08 Jako