Ensure proper file extension for image files
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@116 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
81d548ec11
commit
c2ce12b09e
2 changed files with 12 additions and 2 deletions
|
@ -2,6 +2,8 @@ Changelog for Writer2LaTeX version 1.0 -> 1.2
|
||||||
|
|
||||||
---------- version 1.1.8 ----------
|
---------- version 1.1.8 ----------
|
||||||
|
|
||||||
|
[all] Image files are now extracted with proper file extension, even if the ODF manifest contains no media type
|
||||||
|
|
||||||
[all] Added support for images in EMF format (Enhanced Windows Meta Files)
|
[all] Added support for images in EMF format (Enhanced Windows Meta Files)
|
||||||
|
|
||||||
[w2l] Bugfix: No longer decodes URLs in links (hyperref.sty has no problem with sequences like %E4)
|
[w2l] Bugfix: No longer decodes URLs in links (hyperref.sty has no problem with sequences like %E4)
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
*
|
*
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Version 1.2 (2011-02-19)
|
* Version 1.2 (2011-07-22)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -132,7 +132,15 @@ public final class ImageLoader {
|
||||||
EmbeddedBinaryObject object = (EmbeddedBinaryObject) obj;
|
EmbeddedBinaryObject object = (EmbeddedBinaryObject) obj;
|
||||||
blob = object.getBinaryData();
|
blob = object.getBinaryData();
|
||||||
sMIME = object.getType();
|
sMIME = object.getType();
|
||||||
sExt = MIMETypes.getFileExtension(sMIME);
|
if (sMIME.length()>0) {
|
||||||
|
// If the manifest provides a media type, trust that
|
||||||
|
sExt = MIMETypes.getFileExtension(sMIME);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Otherwise determine it by byte inspection
|
||||||
|
sMIME = MIMETypes.getMagicMIMEType(blob);
|
||||||
|
sExt = MIMETypes.getFileExtension(sMIME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// This is a linked image
|
// This is a linked image
|
||||||
|
|
Loading…
Add table
Reference in a new issue