unidoc / unipdf

Golang PDF library for creating and processing PDF files (pure go)
https://unidoc.io
Other
2.48k stars 250 forks source link

[BUG] creator.Draw causes PDF to warp under certain conditions after update in 3.12.3 #428

Closed echarrod closed 3 years ago

echarrod commented 3 years ago

Description

After updating from 3.7.0 -> 3.13.0, when a number of conditions are met, the whole PDF becomes warped. From my own investigations it looks like: when calling creator.Draw on any of the 3 elements I am drawing onto the PDF (attached below)

From change notes for 3.12.3, looks like this might be something to do with it?

Improved speed and memory usage of drawing creator blocks to pages. USD-8

Expected Behavior

Image is optimised, PDF stays the same visually

Actual Behavior

Steps to reproduce the behavior: 1) Open the attached project 2) Run go test ./... 3) Inspect the produced PDF in /testdata 4) Change any of the criteria above (e.g. change unidoc version to 3.12.2) 5) Run test again - this is how the PDF should look

Input file: image

Output file: image

Attachments

I will email the code snippet separately

github-actions[bot] commented 3 years ago

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

gunnsth commented 3 years ago

@echarrod Thanks for your well written report. Your conclusion seems likely. We will take a look at this.

echarrod commented 3 years ago

Can confirm this issue disappears after upgrading to 3.19.0 - https://github.com/unidoc/unipdf/releases/tag/v3.19.0 Thanks