Code Monkey home page Code Monkey logo

Comments (8)

LeoHsiao1 avatar LeoHsiao1 commented on July 23, 2024
  1. 你的 PNG 图片本来有元数据吗?
  2. 给这个 PNG 写入元数据,可以再读取到吗?

from pyexiv2.

helinxuan avatar helinxuan commented on July 23, 2024

你好png图片我设置了拍照日期,尝试了所有的read方法,打印出来都是空的,我用同样的方法修改jpg就可以读取并修改成功
image

from pyexiv2.

LeoHsiao1 avatar LeoHsiao1 commented on July 23, 2024

可以把你这张图片压缩之后发我邮箱试试吗?
或者你尝试写入元数据,再读取

from pyexiv2.

helinxuan avatar helinxuan commented on July 23, 2024

from pyexiv2.

helinxuan avatar helinxuan commented on July 23, 2024

好的已经发你邮箱了,我尝试了写入后读取,可以读出来,但是在电脑上看拍摄日期并没有被改动

from pyexiv2.

LeoHsiao1 avatar LeoHsiao1 commented on July 23, 2024

我没有收到,请做成压缩包之后发到这个邮箱:
[email protected]

from pyexiv2.

LeoHsiao1 avatar LeoHsiao1 commented on July 23, 2024

我尝试读取这张 PNG 图片,它存在 XMP 元数据:

>>> img = pyexiv2.Image(r"C:\Users\Leo\Desktop\2014-09-28 153216.png")
>>> img.read_exif()
{}
>>> img.read_iptc()
{}
>>> img.read_xmp()
{'Xmp.xmp.CreateDate': '9119-06-23T19:45:17.834'}

然后我用 exiftool 查看其数据结构,如下:

leo@Leo:/$ exiftool -v "2014-09-28 153216.png"
  ExifToolVersion = 12.29
  FileName = 2014-09-28 153216.png
  Directory = .
...
PNG pHYs (9 bytes):
  + [BinaryData directory, 9 bytes]
  | PixelsPerUnitX = 3779
  | PixelsPerUnitY = 3779
  | PixelUnits = 1
PNG tEXt (33 bytes):
  CreationTime = 1997:07:15 18:46:52
PNG IDAT (9 chunks, total 549509 bytes)
PNG IEND (end of image)

可见它没有其它符合 EXIF、IPTC、XMP 规范的元数据,只有一个 PNG tEXt 字段记录了拍摄日期。

from pyexiv2.

helinxuan avatar helinxuan commented on July 23, 2024

感谢解答,我尝试把图片转化成jpg格式就可以了

from pyexiv2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.