Due to server problems the website is temporarily offline! Visit http://www.smorgasbordet.com/pellesc/ to download Pelles C.
Hi all ,I need to read info from jpg file ( H, W etc) how i can do it?CiaoLuca
I'm tryng to build library based on libjpeg but without success.
#include <stdio.h>#include <stdlib.h>#include <jpeglib.h>#include <jerror.h>#pragma comment(lib, "jpeglib.lib")int main(int argc, char** argv){ struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; FILE *infile; if ((infile = fopen(argv[1], "rb")) == NULL) { fprintf(stderr, "Can't open %s\n", argv[1]); exit(1); } // Create decompression object. cinfo.err = jpeg_std_error(&jerr); jpeg_create_decompress(&cinfo); jpeg_stdio_src(&cinfo, infile); // Get all compression parameters. jpeg_read_header(&cinfo, TRUE); fprintf(stdout, "w: %d h: %d\n", cinfo.image_width, cinfo.image_height); // Destroy decompression object. jpeg_destroy_decompress(&cinfo); fclose(infile); return 0;}