Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Converting MCIDAS to PDF results in empty file

Open OskarPersson opened this issue 7 years ago • 6 comments

What did you do?

Converted MCIDAS .ara-file to PDF

What did you expect to happen?

A PDF would be created with content similar to the source

What actually happened?

An empty PDF was created

What versions of Pillow and Python are you using?

Pillow 5.2.0 and Python 2.7.15

The tested file

ara = Image.open("Tests/images/cmx3g8_wv_1998.260_0745_mcidas.ara")
rgb_ara = ara.convert('RGB')
rgb_ara.save('output.pdf')

OskarPersson avatar Sep 13 '18 20:09 OskarPersson

If I run your code, the PDF is a white image 1,800 by 400.

However, this is also what I get if I show the image instead -

from PIL import Image
ara = Image.open("cmx3g8_wv_1998.260_0745_mcidas.ara")
ara.show()

I presume that you think the image is not just a while rectangle? What program are you using to view the original file?

radarhere avatar Sep 15 '18 01:09 radarhere

I viewed it by converting it to a PNG and then opening the resulting file in Apple's Preview app

from PIL import Image
ara = Image.open("cmx3g8_wv_1998.260_0745_mcidas.ara")
ara.save("output.png")

OskarPersson avatar Sep 16 '18 10:09 OskarPersson

I think this is related to #3159

radarhere avatar May 05 '19 03:05 radarhere

I've created PR #3838 to resolve this.

radarhere avatar May 09 '19 01:05 radarhere

Resolved by #3838

radarhere avatar Jun 05 '19 20:06 radarhere

It turns out that this situation is more complicated. See https://github.com/python-pillow/Pillow/pull/3838#discussion_r292114051

radarhere avatar Jun 11 '19 09:06 radarhere

Closing, as part of #3159

radarhere avatar Apr 23 '23 06:04 radarhere