Upgrade from 2.0.1 -> 2.4.0 Changing Rendering of Transparent PNG

25 views
Skip to first unread message

Ryan Culpepper

unread,
Apr 20, 2021, 3:13:23 AM4/20/21
to Prawn
Hello,

I've recently inherited and was tasked with updating an application that uses Prawn.  Specifically, prawn was updated from 2.0.1 to 2.4.0.  Before the update, pdfs generated with two transparent PNGs on each page were working just fine.  After the update, one of the two images (from what I can tell, the images have all of the same properties, channels, etc.) displays as a black box.  The code that generates the pdf in app wasn't changed as a result of the upgrade.

Each is wrapped in a bounding_box block, i.e.:

```bounding_box() do
            image(open "path/to/file.png", some: options)
   end ```

The working image has a float wrapped around it as well and the fill_color in the bounding_box set to 'ffffff', but I've added both to the non-working one and it didn't change anything.

I've attempted downgrading back to 2.0.1, but now I receive an error about palleted PNGs not being able to have transparency.  Odd because this error wasn't raised before.

Here is the prawn section of my Gemfile.lock pre and post upgrade.
   
prawn (2.0.1) 
    pdf-core (~> 0.5.1) 
    ttfunk (~> 1.4.0)

prawn (2.4.0)
      pdf-core (~> 0.9.0)
      ttfunk (~> 1.7)


I'm pretty new to Prawn, so any help is much appreciated it :). 
Reply all
Reply to author
Forward
0 new messages