0

I'm extracting a page from a PDF file and saving it as a JPG file with python. Things goes wrong when saving the image, the date is incorrect.

from wand.image import Image
path = 'C:\\Users\\Name\\Dropbox\\filename.pdf'

with Image(filename=path+"[0]", resolution=500) as img:
    img.save(filename="C:/Users/Name/Documents/cut_filename.jpg")

enter image description here

When I'm using print(datetime.now()) this gives me the correct date and time.

How is this possible and how can I fix this?

Jelmer
  • 351
  • 1
  • 15
  • Is that the date of your PDF maybe? – Mark Setchell Jul 26 '19 at 09:14
  • The PDF date is 12-Aug-15. I can assume were 2015 is coming from – Jelmer Jul 26 '19 at 09:16
  • Wand doesn't handle any datetime on image i/o. Only for parsing ImageMagick release date string. ImageMagick will always write a "date:create" & "date:modify" property. Does `magick filename.pdf[0] cut_filename.jpg` show the same behavior? – emcconville Jul 26 '19 at 15:26
  • 1
    Date and times of output are controlled by your OS not ImageMagick. They are the creation dates of the output JPG, not of the input PDF. What date and time do you want? For what image? – fmw42 Jul 26 '19 at 19:39

0 Answers0