jpegoptim

Python: Optimizing Images in Memory (StringIO & POpen with jpegoptim)

喜欢而已 提交于 2019-12-11 12:47:51
问题 I'm trying to compress images without touching disk using the STDIN version of various libraries(jpegoptim in this example). This code does not return an optimized(jpegoptim compressed) image. Can someone please help or explain why this usage of Popen() with a StringIO.StringIO() object does not return the optimized version of the image? If I save the file to disk, it works just fine. import sys import urllib2 as urllib import StringIO from subprocess import Popen, PIPE, STDOUT fp = urllib

jpegoptim on ASP.Net - “error opening temporary file”

天大地大妈咪最大 提交于 2019-12-11 06:16:36
问题 I suspect I'm failing to understand where jpegoptim tries to write its temp files. I have IIS 7.5 running an ASP.Net 4 AppDomain. In it I have a process that optimizes JPEGs with jpegoptim like so: FileHelper.Copy(existingPath, optimizerPath); var jpegOptimResult = await ImageHelper.JpegOptim(optimizerPath, 30); Running locally I get an optimized image. Running on the above server I get: D:\www\hplusf.com\b\pc\test.jpg 4096x2990 24bit N Adobe [OK] jpegoptim: error opening temporary file. I