Has anyone of you got the plugin “Resize Image On Upload” to work under Modx 3?
I changed the “require_once” path from “/core/model/phpthumb/phpthumb.class.php” to “/core/vendor/james-heinrich/phpthumb/phpthumb.class.php”. This was displayed as an error in the error log. But after the change I have no more errors in the logs but it still doesn’t work properly.
Has anyone had any experience with this?
Alternative question: How do you do that for your customers/authors who are not technically versed that images are reduced in size when uploading?
If the plugin property “log” is set to “Yes”, the plugin “ResizeImageOnUpload” should create a log file for each uploaded image with more information under core/cache/logs/. Maybe take a look at those files to make sure the file paths are correct.
When I test it in MODX 3, the plugin still seems to work.
The only problem I see, is when the image gets renamed on upload (system setting upload_translit = “Yes”). Because of a bug, the plugin code still gets the old file name and therefore can’t find the image file and resize it. To fix it, you may have to apply this pull request:
I tested this with php 7.4 - 8.1…
The only error I have in the log is this:
(ERROR @ /core/vendor/james-heinrich/phpthumb/phpthumb.class.php : 1814) PHP warning: getimagesize(/assets/bilder/test/Druckertest-A4.jpg): failed to open stream: No such file or directory
If I simply make a call on the website, the images are calculated correctly.
[[!phpthumbof? &input=/assets/img/xxx.jpg &options=&w=640&h=480&zc=1&aoe=0&far=0]]
The images are then located as usual in “/core/cache/phpthumb/”