From c078564798551800fed78c2dd4f8163552270f6a Mon Sep 17 00:00:00 2001 From: henrikjust Date: Fri, 5 Aug 2011 08:20:56 +0000 Subject: [PATCH] Support JPEG images with EXIF data git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@123 f0f2a975-2e09-46c8-9428-3b39399b9f3c --- source/distro/changelog.txt | 2 ++ source/java/writer2latex/office/MIMETypes.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/distro/changelog.txt b/source/distro/changelog.txt index 6f985b4..79c7703 100644 --- a/source/distro/changelog.txt +++ b/source/distro/changelog.txt @@ -2,6 +2,8 @@ Changelog for Writer2LaTeX version 1.0 -> 1.2 ---------- version 1.1.8 ---------- +[all] Added support for JPEG images with EXIF data + [w2x] Implemented the option separate_stylesheet to separate the style sheet from the XHTML files (has no effect on EPUB export) [all] Added Catalan translation from Martí Ruiz-Altaba diff --git a/source/java/writer2latex/office/MIMETypes.java b/source/java/writer2latex/office/MIMETypes.java index 4c5433d..a9d426a 100644 --- a/source/java/writer2latex/office/MIMETypes.java +++ b/source/java/writer2latex/office/MIMETypes.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.2 (2011-07-22) + * Version 1.2 (2011-08-05) * */ @@ -50,6 +50,7 @@ public final class MIMETypes extends writer2latex.api.MIMETypes { // Magic signatures for some binary files public static final byte[] PNG_SIG = { (byte) 0x89, 0x50, 0x4e, 0x47 }; // .PNG public static final byte[] JPEG_SIG = { (byte) 0xff, (byte) 0xd8, (byte) 0xff, (byte) 0xe0 }; + public static final byte[] JPEG_EXIF_SIG = { (byte) 0xff, (byte) 0xd8, (byte) 0xff, (byte) 0xe1 }; public static final byte[] GIF87_SIG = { 0x47, 0x49, 0x46, 0x38, 0x37, 0x61 }; // GIF87a public static final byte[] GIF89_SIG = { 0x47, 0x49, 0x46, 0x38, 0x39, 0x61 }; // GIF89a public static final byte[] TIFF_SIG = { 0x49, 0x49, 0x2A }; // II* @@ -90,6 +91,7 @@ public final class MIMETypes extends writer2latex.api.MIMETypes { public static final String getMagicMIMEType(byte[] blob) { if (isType(blob,PNG_SIG)) { return PNG; } if (isType(blob,JPEG_SIG)) { return JPEG; } + if (isType(blob,JPEG_EXIF_SIG)) { return JPEG; } if (isType(blob,GIF87_SIG)) { return GIF; } if (isType(blob,GIF89_SIG)) { return GIF; } if (isType(blob,TIFF_SIG)) { return TIFF; }