Domanda

im using MiniMagick to resize some images on my server. I am having issues forcing dimensions on it. The MiniMagick git documentation states that it uses the mogrify commands. Looking into it further, There are sever commands you can use in your resize such as:

-resize "230x200>" -resize "230x200<" -resize "230x200!"

I am looking to use the ! but it seems like it is not working.

     img = sftp.download!("local_promos/#{@image_name}")  
     ri = MiniMagick::Image.read(img)
     ri.resize "230x200!" # ! get ignored and it does not resize
     ri.write('#{img_dir}#{@image_name}')

i ran mogrify command in the command like and it worked fine. What seems to be the issue?

È stato utile?

Soluzione

The Problem was the gem mini_magic. I was using -v 3.5.0. it was escaping string using Shellwords.escape(value.to_s) The newer version 3.6.0 fixed my issue.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top