Description: After I inserted an image to Libreoffice Writer and cropped it, I exported the document to pdf. But the image in the pdf file is not cropped correctly. You can download a sample document on google drive. I am using Libreoffice 5.3.4 on Manjaro Linux. Steps to Reproduce: 1. Open a new document in Writer 2. Click Insert > Image... to insert the image 3. Right click on the image and click Crop 4. Crop the black region on the right and left(so the margin of image contacts the margin of the microsope's view) 5. Save the document and export to pdf Actual Results: The image in the exported pdf is not cropped correctly. In the right side and left side of the microsope's view, there is black region. Expected Results: The margin of image contacts the margin of the microsope's view, same as seen in writer. Reproducible: Always User Profile Reset: Yes Additional Info: same result whether "Use OpenGL for all rendering" is enabled User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0
Created attachment 134658 [details] odt file containing the cropped image
Created attachment 134659 [details] the image file
Created attachment 134660 [details] the exported pdf file
*** This bug has been marked as a duplicate of bug 45168 ***
(In reply to V Stuart Foote from comment #4) > > *** This bug has been marked as a duplicate of bug 45168 *** Sorry, but this is definitely a different problem than bug +45168. +45168 is only about document size, the problem here is that the exported PDF looks different than the original document. By the way, I've had the same problem with Impress presentation and version 6.0.0. The presentation contains a few pictures, some of them cropped to show only a small detail. The exported PDF then not only contains but _shows_ the whole pictures. To make things worse, the aspect ratio of the picture is adjusted to that of the cropped picture
OK, subtle but current export to PDF does not honor the image clip and instead inserts the full image into frame holding the image on document canvas--distorting it. The example document here, the clip applied was only horizontal, and results on export PDF image squeezed to fit into the frame. The resulting size of PDF export includes the whole unclipped image, initial issue of bug 45168, but restated in https://bugs.documentfoundation.org/show_bug.cgi?id=45168#c10 The same document printed to PDF (with a PS based flow) correctly clips the image, and its size is reduced. Scope of bug 45168 would impact this.
Regression introduced by: author Michael Meeks <michael.meeks@collabora.com> 2016-02-08 14:24:15 +0000 committer Michael Meeks <michael.meeks@collabora.com> 2016-02-09 00:09:08 +0000 commit 76ec54e8c9f3580450bca85236a4f5af0c328588 (patch) tree 1c4d36e921be16426fc8a61c7a85bdc006e0fafa parent e07ffae5046e9c91ef96026435cab84c3bcb4534 (diff) tdf#97662 - Try to preserve original compressed JPEGs harder. Avoiding de-compressing and re-compressing them saves lots of time too. Bisected with: bibisect-linux-64-5.2 Adding Cc: to Michael Meeks
Same problem here.. We add product images in a presentation (impress) with many slides. We crop a little the sides of images and resize. On screen it appear fine but when exporting to PDF, all images are not in the correct proportion and is unusable (images is lengthened). Version: 6.0.3 (but exist also in past versions)
I can reproduce the problem, I plan to take a look at this.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=be3ef7b0e5e51c1d97309ce3b6d5cac1fbd025d0 tdf#109143 PDF export: don't reuse compressed bitmaps for cropped images It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks Miklos Vajna for your patch. Is it also possible to backport it to 5.4.x and 6.0.x ?
I've proposed the fix for 6.0.x at https://gerrit.libreoffice.org/53772, will consider 5.4.x if 6.0.x is in.
Verified in Version: 6.1.0.0.alpha1+ Build ID: f1579d3d6c5f5f3a651825e035b93bee7a4f43c6 CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); Calc: group @Miklos, thanks for fixing this! I'm wondering if you would be interested in the other bugs introduced by 76ec54e8c9f3580450bca85236a4f5af0c328588 listed in meta bug 116840
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-6-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e0ae55f7cefe74039f8ade1696d1861e90d73c04&h=libreoffice-6-0 tdf#109143 PDF export: don't reuse compressed bitmaps for cropped images It will be available in 6.0.5. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
*** Bug 117756 has been marked as a duplicate of this bug. ***
*** Bug 118126 has been marked as a duplicate of this bug. ***