You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would suggest following convention: If an argument is a symbol, it is an ordinary -command. If it is a string, the user takes care of the prefix by himself.
Alternative: Convert Symbol to string, check if it has a prefix (+ or -). If not, add -
The text was updated successfully, but these errors were encountered:
This was possible through the current public interface, but only just. I was relying on the fact that the convert output filename isn't escaped to pass in arbitrary command strings.
Going into production like that seemed like a bad idea, and the rest of my usage of ImageSorcery in this instance was minimal, so I opted to drop the dependency and go straight to ImageMagick via Process.spawn in the calling code instead, which also prevents shell escaping issues.
ImageSorcery only supports
-commands
, but there are also some+commands
, like+repage
https://github.com/EricR/image_sorcery/blob/master/lib/image_sorcery.rb#L135-L138
I would suggest following convention: If an argument is a symbol, it is an ordinary
-command
. If it is a string, the user takes care of the prefix by himself.Alternative: Convert Symbol to string, check if it has a prefix (
+
or-
). If not, add-
The text was updated successfully, but these errors were encountered: