Skip to content

Commit

Permalink
jpeg read is less fussy about exif data
Browse files Browse the repository at this point in the history
even read truncated exif
  • Loading branch information
jcupitt committed Nov 21, 2012
1 parent 006d4ec commit 65b4056
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- look into preserving IPTC data

- check libtool version number, should be binary-compat with 7.30

Expand Down
41 changes: 19 additions & 22 deletions libvips/foreign/jpeg2vips.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
*/

/*
*/
#define DEBUG_VERBOSE
#define DEBUG
*/

#ifdef HAVE_CONFIG_H
#include <config.h>
Expand Down Expand Up @@ -598,39 +598,36 @@ read_exif( VipsImage *im, void *data, int data_length )
#ifdef HAVE_EXIF
{
ExifData *ed;
VipsExif ve;

if( !(ed = exif_data_new_from_data( data, data_length )) )
return( -1 );

if( ed->size > 0 ) {
VipsExif ve;

#ifdef DEBUG_VERBOSE
show_tags( ed );
show_values( ed );
show_tags( ed );
show_values( ed );
#endif /*DEBUG_VERBOSE*/

/* Attach informational fields for what we find.
/* Attach informational fields for what we find.
FIXME ... better to have this in the UI layer?
FIXME ... better to have this in the UI layer?
Or we could attach non-human-readable tags here (int,
double etc) and then move the human stuff to the UI
layer?
Or we could attach non-human-readable tags here (int,
double etc) and then move the human stuff to the UI
layer?
*/
ve.image = im;
ve.ed = ed;
exif_data_foreach_content( ed,
(ExifDataForeachContentFunc) attach_exif_content, &ve );
*/
ve.image = im;
ve.ed = ed;
exif_data_foreach_content( ed,
(ExifDataForeachContentFunc) attach_exif_content, &ve );

/* Look for resolution fields and use them to set the VIPS
* xres/yres fields.
*/
set_vips_resolution( im, ed );
/* Look for resolution fields and use them to set the VIPS
* xres/yres fields.
*/
set_vips_resolution( im, ed );

attach_thumbnail( im, ed );
}
attach_thumbnail( im, ed );

exif_data_free( ed );
}
Expand Down

0 comments on commit 65b4056

Please sign in to comment.