* EXIF data is now also parsed in case there was no ioExtension message passed in;

the orientation was only honoured in case there was a message before.
* Disabled error alerts; they are more annoying than helpful.
* Bumped version to 1.2.0.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20664 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-04-12 13:20:33 +00:00
parent 22cf4a3be6
commit f13b5de61e
2 changed files with 16 additions and 14 deletions

View File

@ -53,7 +53,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
char translatorName[] = "JPEG Images";
char translatorInfo[] =
"©2002-2003, Marcin Konicki\n"
"©2005-2006, Haiku\n"
"©2005-2007, Haiku\n"
"\n"
"Based on IJG library © 1991-1998, Thomas G. Lane\n"
" http://www.ijg.org/files/\n"
@ -63,7 +63,7 @@ char translatorInfo[] =
"With some colorspace conversion routines by Magnus Hellman\n"
" http://www.bebits.com/app/802\n";
int32 translatorVersion = 0x111;
int32 translatorVersion = 0x120;
// Define the formats we know how to read
translation_format inputFormats[] = {
@ -1379,31 +1379,29 @@ Decompress(BPositionIO *in, BPositionIO *out, BMessage* ioExtension)
jpeg_create_decompress(&cinfo);
be_jpeg_stdio_src(&cinfo, in);
#if 1
jpeg_save_markers(&cinfo, MARKER_EXIF, 131072);
// make sure the EXIF tag is stored
#endif
// Read info about image
jpeg_read_header(&cinfo, TRUE);
BMessage exif;
if (ioExtension != NULL) {
// add EXIF data to message, if any
jpeg_marker_struct* marker = cinfo.marker_list;
while (marker != NULL) {
if (marker->marker == MARKER_EXIF
&& !strncmp((char*)marker->data, "Exif", 4)) {
// parse EXIF data and add it ioExtension, if any
jpeg_marker_struct* marker = cinfo.marker_list;
while (marker != NULL) {
if (marker->marker == MARKER_EXIF
&& !strncmp((char*)marker->data, "Exif", 4)) {
if (ioExtension != NULL) {
// Strip EXIF header from TIFF data
ioExtension->AddData("exif", B_RAW_TYPE,
(uint8 *)marker->data + 6, marker->data_length - 6);
BMemoryIO io(marker->data + 6, marker->data_length - 6);
convert_exif_to_message(io, exif);
}
marker = marker->next;
BMemoryIO io(marker->data + 6, marker->data_length - 6);
convert_exif_to_message(io, exif);
}
marker = marker->next;
}
// Default color info

View File

@ -67,8 +67,10 @@ be_error_exit (j_common_ptr cinfo)
/* Create the message */
(*cinfo->err->format_message) (cinfo, buffer);
#if 0
/* show error message */
(new BAlert("JPEG Library Error", buffer, "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
#endif
/* Let the memory manager delete any temp files before we die */
jpeg_destroy(cinfo);
@ -88,10 +90,12 @@ be_output_message (j_common_ptr cinfo)
/* Create the message */
(*cinfo->err->format_message) (cinfo, buffer);
#if 0
/* If it's compressing or decompressing and user turned messages on */
if (!cinfo->is_decompressor || cinfo->err->ShowReadWarnings)
/* show warning message */
(new BAlert("JPEG Library Warning", buffer, "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
#endif
}