0
Under review

GraphicsMagick Thumbnail Generation not working

sascha 3 months ago updated by Rudhra 3 months ago 3

Hello,

After using FileRun for a while without any thumbnails for images or videos I decided today to set up GraphicsMagick and ffmpeg. After failing back and forth with all the different user rights and folder permissions on my Windows Server I finally got ffmpeg to work flawlessly, but GraphicsMagick is still not working, unfortunately.

Debugging is on (1626096238)
Request options:
Array
(
    [skipNotification] => 1
    [caching] => 
    [debug] => 1
)
In use options:
Array
(
    [skipNotification] => 1
    [caching] => 
    [debug] => 1
    [width] => 400
    [height] => 400
    [geometry] => contain
    [pageNo] => 0
    [forceExt] => jpeg
)
Processing: X:/drive/home/Alina/34539C9A-64B6-4895-90DD-CE7998202EEA.jpeg
As: jpeg
File size: 5467087 bytes (5.2 MB)
File is safe for web.
File is larger than 5 MB so it will get processed.
Removing expired lock: C:/wamp64/www/subdomains/drive/thumbnail-cache/X/drive/home/Alina/34539C9A-64B6-4895-90DD-CE7998202EEA.jpeg/5467087/400_400_contain[1].png.lock
Creating lock: C:/wamp64/www/subdomains/drive/thumbnail-cache/X/drive/home/Alina/34539C9A-64B6-4895-90DD-CE7998202EEA.jpeg/5467087/400_400_contain[1].png.lock
Resizing using ImageMagick
Running: "C:/Program Files/GraphicsMagick-1.3.35-Q16/gm.exe" -size "400x400" "X:/drive/home/Alina/34539C9A-64B6-4895-90DD-CE7998202EEA.jpeg" -verbose -auto-orient -thumbnail "400x400>" -strip -quality 95 "C:/wamp64/www/subdomains/drive/thumbnail-cache/X/drive/home/Alina/34539C9A-64B6-4895-90DD-CE7998202EEA.jpeg/5467087/400_400_contain[1].png" && exit
Results:
 * returned code: 1
 * returned text: Array
(
)
Resize failed.
Displaying icon for jpeg extension instead.


As you can see I'm using GraphicsMagick 1.3.35 and maybe this is already part of or the actual problem. With this version "gm -size ..." is not a valid command, it has to be "gm convert -size..." to properly work. So 

Therefore my questions:


  • Do I have to use an older GraphicsMagick version that does not require the "convert" before "-size"? Which GraphicsMagick version would that be on Windows?
  • Or is there a way to add the "convert" somehow before all the other thumbnail generation arguments?

Thanks for your help,

Sascha

Under review

You can edit the path to make it "gm.exe convert"

Changing the path in FileRun Settings to include convert does not work:

Running: "gm convert" -size '1240x500' "/user-files/intern/Name/Shopping/Marktplaats/signal-2021-07-11-113656.jpg" -verbose -auto-orient -thumbnail '1240x500>' -strip -quality 95 "/user-files/intern/Name/Shopping/Marktplaats/.filerun.thumbnails/signal-2021-07-11-113656.jpg/79505/1240_500_contain[1].png" 2>&1
Results:
 * returned code: 127
 * returned text: Array
(
    [0] => sh: 1: gm convert: not found
)
Resize failed.
Displaying icon for jpg extension instead.

This is because it should be gm convert instead of "gm convert".
When I run this command within the container, it works:


gm convert -size '1240x500' 
"/user-files/intern/Name/Shopping/Marktplaats/signal-2021-07-22-155445
 (1).jpg" -verbose -auto-orient -thumbnail '1240x500>' -strip 
-quality 95 
"/user-files/intern/Rudhra/Shopping/Marktplaats/.filerun.thumbnails/signal-2021-07-22-155445
 (1).jpg/131227/1240_500_contain[1].png" 2>&1
/user-files/intern/Name/Shopping/Marktplaats/signal-2021-07-22-155445 (1).jpg JPEG 1200x1600=>375x500+0+0 DirectClass 8-bit 0.060u 0m:0.069655s (26.3Mi pixels/s)
/user-files/intern/Name/Shopping/Marktplaats/signal-2021-07-22-155445 (1).jpg=>/user-files/intern/Name/Shopping/Marktplaats/.filerun.thumbnails/signal-2021-07-22-155445 (1).jpg/131227/1240_500_contain[1].png PNG 1200x1600=>375x500+0+0 DirectClass 8-bit 200.0Ki 0.230u 0m:0.209343s (8.7Mi pixels/s)

It also works with "gm" convert -size ...

But this will not work obviously:


"gm convert" -size '1240x500' 
"/user-files/intern/Name/Shopping/Marktplaats/signal-2021-07-22-155445
 (1).jpg" -verbose -auto-orient -thumbnail '1240x500>' -strip 
-quality 95 
"/user-files/intern/Name/Shopping/Marktplaats/.filerun.thumbnails/signal-2021-07-22-155445
 (1).jpg/131227/1240_500_contain[1].png" 2>&1
bash: gm convert: command not found

In FileRun Settings > Files > Thumbs and Previews > ImageMagick support > Direct Exec, it doesn't matter if you add/remove quotes, FileRun will always execute whatever you put in that field, with double quotes around it.

I suspect we need to modify a php file somewhere..