I know there is cl-magick but I couldnt find a function to convert byte-vectors into byte-vectors, and I have my reasons why I load the files into byte-vectors, and dont access the files directly (and as written below, this shouldnt be the problem here).

The whole code seems to work, but returns strange output, when running convert manually, and then encoding it with uuencode --base64, something completely different results.

To find the error, I replaced 32x32! by 1x1! and removed the base64-encoding. The resulting vector is correct - when I convert the file manually and look at the bytes written, the result is the same. Only the base64-encoded result is different.

So there must be something wrong with cl-base64. Any suggestions?

EDIT:Ok, I have made my own Base64-Implementation, and with it, it works:

I wonder if it is better to just keep my own little implementation of base64. Its certainly a little slower, but on the other hand I do not have to convert the List into an Array first, and i will have one dependency less.

I would like to implement the whole stuff implementation-independent, but actually I cannot find any library for command-execution which works on multiple implementations.

Thank you. No, I dont think that it is good for this purpose, as it works only with strings. I cannot pass a byte-vector as input and grab a byte-vector as output. Actually I cannot even see how to easily patch the code for this purpose.

I could try to use flexi-streams and convert the byte-vector to a string, but this would be only a hack. I could use uudecode and uuencode around the convert-command, but this would also be a hack.

Regarding the original post, the function to read an image from memory into an ImageMagick wand seems to be MagickReadImageBlob, so it is possible to use the API to do this.

Another somewhat portable way would be to go through a temporary file. It should be also possible to do the resize using only Lisp code. I have even written some time ago a pure-Lisp png reader, although it is rather slow and not tested much. There are some libpng bindings, but that would obviously require foreign code. And there is ZPNG for writing. This would leave only the resizing algorithm to be implemented.