libjpeg

Install libjpeg v8 to /opt/local

别来无恙 提交于 2019-12-13 03:44:26
问题 How do I install libjpeg 8 to /opt/local on OSX? The reason I am asking is that I would like to create small movies of brain activity using the MNE-C libraries. I executed 'mne_make_movie' which results in the following error: Movie production selected (from data)... Scanning /Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib for plugins Found lqt_mjpeg.so...Getting codec info from module Trying to load /Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so... dlopen failed for /Users

Changing DCT coefficients

扶醉桌前 提交于 2019-12-12 20:26:15
问题 I decided to use libjpeg as the main library working with jpeg files. I've read libjpg.txt file. And I was pleased that library allows DCT coefficients reading/writing in a convenient way. Since writing an own decoder will take a long time. My work is related to the lossless embedding. Currently I need to read DCT coefficients from a file then modify some of them and write changed coefficients in the same file. Well, I found jpeg_write_coefficients() function. And I naively thought that I

write a jpeg with libjpeg (seg fault)

一曲冷凌霜 提交于 2019-12-12 14:58:54
问题 Trying to write a jpeg file from some raw data using libjpeg. It triggers a Segmentation Fault in jpeg_start_compress() Here is the relevant part of the code : void write_sub_image(char *filename, int start, int end) { struct jpeg_compress_struct cinfo; unsigned char *stride; JSAMPROW row_pointer[1]; unsigned long new_width = end-start; int i; FILE *fp; stride = (unsigned char *)malloc( new_width * 3); fp = fopen(filename, "w+"); jpeg_create_compress(&cinfo); jpeg_stdio_dest(&cinfo, fp);

How to release buffer created by libjpeg?

妖精的绣舞 提交于 2019-12-12 12:57:04
问题 I am using libjpeg to transform image buffer from OpenCV Mat and write it to a memory location Here is the code: bool mat2jpeg(cv::Mat frame, unsigned char **outbuffer , long unsigned int *outlen) { unsigned char *outdata = frame.data; struct jpeg_compress_struct cinfo = { 0 }; struct jpeg_error_mgr jerr; JSAMPROW row_ptr[1]; int row_stride; *outbuffer = NULL; *outlen = 0; cinfo.err = jpeg_std_error(&jerr); jpeg_create_compress(&cinfo); jpeg_mem_dest(&cinfo, outbuffer, outlen); jpeg_set

jpegtran whole directory

左心房为你撑大大i 提交于 2019-12-12 08:04:42
问题 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 {} {} \; 回答1: Answer: find /img/path -name "*.jpg" -type f -exec jpegtran -copy none -optimize -outfile {} {} \; 来源: https://stackoverflow.com

Is there any easy way to edit jpeg marker data in-place?

拥有回忆 提交于 2019-12-12 04:48:09
问题 I am trying to edit jpeg marker data (eg: exif data) in APP0 section. I used libjpeg to decompress the source file to get exif data and uncompressed image data. I used libexif to modify exif data. Then I compressed the source image data and modified exif data to create a new jpeg file. Instead of doing decompressing and compressing again, I am wondering if there is any way to edit JPEG metadata without re-compressing the original image? (Looks like, I can call jpeg_write_header or jpeg_write

jpegtran.exe not correctly rotating image

淺唱寂寞╮ 提交于 2019-12-11 12:08:41
问题 I have a freshly compiled libjpeg version 9 and tried running jpegtran.exe in command line with the arguments: .\jpegtran.exe -rotate 180 -outfile test_output1.jpg testimg.jpg testimg.jpg: test_output1.jpg: As you can see it does rotate the image but it clips it and it's not put together correctly. The usage.txt file that comes with the package isn't totally up to date because I had to use the -outfile switch instead of what it says: jpegtran uses a command line syntax similar to cjpeg or

how to load jpeg file using DLIB libarary?

别说谁变了你拦得住时间么 提交于 2019-12-11 09:57:46
问题 After attempting to run a example program downloaded from Here, I understand for working with jpeg files , I must add #define DLIB_JPEG_SUPPORT directive to the project. but before that It's necessary to download jpeg library and add it to the project. I did These steps: 1.Download jpegsr9a .zip from here and unzipped it. 2.Download WIN32.mak and paste it into the jpeg root folder 3.Open Developer Command Prompt from visual studio 2013 tools 4.In command prompt type : nmake -f makefile.vc

Can't get Python Imaging Library to find JPEG support

萝らか妹 提交于 2019-12-11 04:45:32
问题 This is on Mountain Lion (OSX 10.8.3). So I downloaded, built, and installed the assorted required libraries. I modified setup.py to refer to the right places... TCL_ROOT = libinclude("/usr") JPEG_ROOT = libinclude("/usr/local") ZLIB_ROOT = libinclude("/usr") FREETYPE_ROOT = libinclude("/usr/local") LCMS_ROOT = libinclude("/usr/local") And running setup.py seems to work... airguitar:Imaging-1.1.7 chuck 597$ python setup.py build_ext -i running build_ext --- using frameworks at /System/Library

Get compression ratio of image

◇◆丶佛笑我妖孽 提交于 2019-12-11 03:05:40
问题 I use LibJPEG to read JPEG compressed images. Is there a way to get the current compression ratio of the unchanged image? 回答1: Do you mean the encoding quality, usually a number 0-100? That isn't stored - it's used as a guide for the image encode as to how accurate the waves should be, and it's then discarded. There's no field for it in any of the JFIF header structures. As far as I can see there's no formal definition of what this number means across encoders and so you can't precisely