Bug 147167 - Dragging a JPG from Firefox to Writer, the image is saved inside ODT as BMP
Summary: Dragging a JPG from Firefox to Writer, the image is saved inside ODT as BMP
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-04 06:12 UTC by Mike Kaganski
Modified: 2022-02-04 06:50 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
A sample JPEG from https://upload.wikimedia.org/wikipedia/commons/thumb/6/62/Henry_Taube_-_HD.3F.005_%2811086397086%29.jpg/350px-Henry_Taube_-_HD.3F.005_%2811086397086%29.jpg (38.09 KB, image/jpeg)
2022-02-04 06:12 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2022-02-04 06:12:59 UTC
Created attachment 178031 [details]
A sample JPEG from https://upload.wikimedia.org/wikipedia/commons/thumb/6/62/Henry_Taube_-_HD.3F.005_%2811086397086%29.jpg/350px-Henry_Taube_-_HD.3F.005_%2811086397086%29.jpg

1. Open https://upload.wikimedia.org/wikipedia/commons/thumb/6/62/Henry_Taube_-_HD.3F.005_%2811086397086%29.jpg/350px-Henry_Taube_-_HD.3F.005_%2811086397086%29.jpg in Firefox (I used 96.0.3 (64-bit) on Windows 10).
2. Drag the image from the browser into a Writer document.
3. Save the document as ODT.
4. Inspect the ODT (zip package) to see that the image is stored in /Pictures as a ~350 KB BMP, not ~38 KB JPEG.

If you download the JPEG locally, and then drag it from Windows Explorer to Writer document, it will be stored as JPEG.

This problem is mentioned on https://forum.openoffice.org/en/forum/viewtopic.php?f=71&t=86682 (see #13), so a longstanding problem. Possibly related to how FF works with Windows clipboard; in any case - even if the image format is unknown - it would possibly make sense to prefer PNG over BMP (using internal Compress, and defining compression level 9 without downsampling, gives smaller image and ODT file size, and also faster operation - possibly because of less disk IO).
Comment 1 Mike Kaganski 2022-02-04 06:50:44 UTC
Looks caused by Firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=557708, and thus NOTOURBUG (since the actual file being inserted into Writer is coming from Firefox saved temporary copy like C:\Users\user\AppData\Local\Temp\dvlz7uhh.bmp), and has the BMP "original" format, which is rightfully kept when stored.