libjpeg

jpegtran whole directory

回眸只為那壹抹淺笑 提交于 2019-12-03 14:23:46
I want to optimize the whole test folder with jpg images from a command line. I found this but it doesn't work: cd /home/site/html/update/test/ find . -exec jpegtran -optimize "{}" "{}.opti.jpg" "{}" \; I want to overwrite the existing images. Suggestions? Answer: find /img/path -name "*.jpg" -type f -exec jpegtran -copy none -optimize -outfile {} {} \; Answer: find /img/path -name "*.jpg" -type f -exec jpegtran -copy none -optimize -outfile {} {} \; 来源: https://stackoverflow.com/questions/15835351/jpegtran-whole-directory

Python, PIL and JPEG on Heroku

孤人 提交于 2019-12-03 11:42:29
问题 I have a Django site, hosted on Heroku . One of the models has an image field, that takes uploaded images, resizes them, and pushes them to Amazon S3 so that they can be stored persistently. This is working well, using PIL def save(self, *args, **kwargs): # Save this one super(Product, self).save(*args,**kwargs) # resize on file system size = 200, 200 filename = str(self.thumbnail.path) image = Image.open(filename) image.thumbnail(size, Image.ANTIALIAS) image.save(filename) # send to amazon

Compiling PHP with GD and libjpeg support

☆樱花仙子☆ 提交于 2019-12-03 08:40:35
问题 I compile my own PHP, partly to learn more about how PHP is put together, and partly because I'm always finding I need modules that aren't available by default, and this way I have control over that. My problem is that I can't get JPEG support in PHP. Using CentOS 5.6. Here are my configuration options when compiling PHP 5.3.8: './configure' '--enable-fpm' '--enable-mbstring' '--with-mysql' '--with-mysqli' '--with-gd' '--with-curl' '--with-mcrypt' '--with-zlib' '--with-pear' '--with-gmp' '-

Error handling in libjpeg

拜拜、爱过 提交于 2019-12-03 05:15:52
I am using the C++ JPEG library (libjpeg) and I have realized that when some functions fail exit() is called and the application is closed. How can I override this behavior and prevent the application from closing on libjpeg errors? This is the default behavior of libjpeg . In order to handle errors with libjpeg, you'll have to define an error handling routine like this: struct jpegErrorManager { /* "public" fields */ struct jpeg_error_mgr pub; /* for return to caller */ jmp_buf setjmp_buffer; }; char jpegLastErrorMsg[JMSG_LENGTH_MAX]; void jpegErrorExit (j_common_ptr cinfo) { /* cinfo->err

Python, PIL and JPEG on Heroku

折月煮酒 提交于 2019-12-03 02:10:29
I have a Django site, hosted on Heroku . One of the models has an image field, that takes uploaded images, resizes them, and pushes them to Amazon S3 so that they can be stored persistently. This is working well, using PIL def save(self, *args, **kwargs): # Save this one super(Product, self).save(*args,**kwargs) # resize on file system size = 200, 200 filename = str(self.thumbnail.path) image = Image.open(filename) image.thumbnail(size, Image.ANTIALIAS) image.save(filename) # send to amazon and remove from ephemeral file system if put_s3(filename): os.remove(filename) return True However, PIL

PIL /JPEG Library: “decoder jpeg not available”

落爺英雄遲暮 提交于 2019-12-03 00:29:33
问题 I tried to use PIL to do some JPEG work in my django app with PIL but I'm getting this IOError.. not sure what to do. ""decoder jpeg not available"" Am I missing the JPEG decoder from my server? If so, how do I fix it? 回答1: You need to install jpeg library first and reinstall your PIL. For example, I'm using CentOS, to install libjpeg, I run sudo yum install -y libjpeg-devel It depends on what kind of linux you are using. And here you have to remove the old PIL rm -rf /usr/lib/python2.6/site

Compiling PHP with GD and libjpeg support

坚强是说给别人听的谎言 提交于 2019-12-02 22:30:35
I compile my own PHP, partly to learn more about how PHP is put together, and partly because I'm always finding I need modules that aren't available by default, and this way I have control over that. My problem is that I can't get JPEG support in PHP. Using CentOS 5.6. Here are my configuration options when compiling PHP 5.3.8 : './configure' '--enable-fpm' '--enable-mbstring' '--with-mysql' '--with-mysqli' '--with-gd' '--with-curl' '--with-mcrypt' '--with-zlib' '--with-pear' '--with-gmp' '--with-xsl' '--enable-zip' '--disable-fileinfo' '--with-jpeg-dir=/usr/lib/' The ./configure output says:

PIL /JPEG Library: “decoder jpeg not available”

夙愿已清 提交于 2019-12-02 14:06:30
I tried to use PIL to do some JPEG work in my django app with PIL but I'm getting this IOError.. not sure what to do. ""decoder jpeg not available"" Am I missing the JPEG decoder from my server? If so, how do I fix it? You need to install jpeg library first and reinstall your PIL. For example, I'm using CentOS, to install libjpeg, I run sudo yum install -y libjpeg-devel It depends on what kind of linux you are using. And here you have to remove the old PIL rm -rf /usr/lib/python2.6/site-packages/PIL-1.1.7-py2.6-linux-x86_64.egg/ Then install the PIL sudo easy_install PIL I have found this

Is it possible to control which libraries apache uses?

天涯浪子 提交于 2019-12-02 13:34:49
问题 Okay, so I had an earlier problem with PIL that is still unresolved. Someone else had this problem and had success by removing the old JPEG library. I can't really do that on my machine, however, as it's RHEL and so many things are dependent on libjpeg and libjpeg-devel (when I tried yum remove libjpeg just to see, there were a total of 252 packages that would have been removed!) I have jpeg-8 installed in /usr/local/lib. It's correctly being used by python, but not by apache. Here's a list

How to build this project? (jpeg lib)

淺唱寂寞╮ 提交于 2019-12-02 12:19:23
Edit: im now using http://code.google.com/p/jpeg-compressor/ so i dont care about making this work anymore. I downloaded the http://ijg.org/ source code, i tried to build it as a DLL file. This is farthest i could build until i went into dead-end. I noticed there was some .c files which i had to delete, but i dont know if i deleted the correct ones, there was at least these files jmemmac.c and jmemdos.c which i figured i dont need. I had to delete jmemmac.c because i compile on windows, but it gave more errors so i kept deleting those useless files, but now i dont know what to do anymore. Here