danielgtaylor / jpeg-archive

Utilities for archiving JPEGs for long term storage.
1.16k stars 122 forks source link

Can jpeg-archive compress file from buffer? #52

Closed elisoncampos closed 6 years ago

elisoncampos commented 7 years ago

Is it possible to compress a file that is not written to the disk? Like, use it in an AWS lambda process so I could compress uploaded files? When you download a file from S3 to use it in lambda all i have is their buffer. I could write it to disk, then compress and upload but that would add processing time that could be saved.

thanks in advance.

javabean commented 7 years ago

Reading from the source code, I believe current version requires a file on disk. Have you tried to "stream" your memory buffer through a UNIX FIFO pipe (man mkfifo), and using that as an input "file"?

lfos commented 6 years ago

Fixed in 76b1868 (Only read input once, 2018-03-14).