Without modifying the source of GraphicsMagick itself, you can’t. The gm
module interacts with the GraphicsMagick program through the command line. The arguments you’re passing through the .in()
method are being converted into command-line arguments. The GraphicsMagick program only accepts filenames for this argument and will not attempt to process any direct form of data.
If you really needed to make this work without the filesystem, you could always download the GraphicsMagick source code and change the CLI to accept some form of data blob instead of a URL for this argument.