児島です。 以下がテスト用のソースです。 /*==============main.cpp==========================*/ #include <stdio.h> #include "jpeglib.h" int main(int argc,char ** argv){ int row_stride; /* physical row width in output buffer */ struct jpeg_decompress_struct dinfo={0}; struct jpeg_error_mgr jerr={0}; FILE * input_file; dinfo.err=jpeg_std_error(&jerr); jpeg_create_decompress(&dinfo); if((input_file=fopen("test.jpg","rb"))==NULL){ fprintf(stderr,"cant open jpg file"); jpeg_destroy_decompress(&dinfo); return 0; } jpeg_stdio_src(&dinfo,input_file); jpeg_read_header(&dinfo,TRUE); jpeg_start_decompress(&dinfo); row_stride=dinfo.output_width*dinfo.output_components; unsigned char * tmp_ptr; tmp_ptr=new unsigned char[row_stride]; while(dinfo.output_scanline<dinfo.output_height){ jpeg_read_scanlines(&dinfo,&tmp_ptr,1); } jpeg_finish_decompress(&dinfo); jpeg_destroy_decompress(&dinfo); fclose(input_file); delete [] tmp_ptr; return 0; } /*==============end===============================*/ kojima@xxxxxxxxxxx 児島