Closed dgtlmoon closed 3 years ago
Thank you for all your work. I found the code for Comment in EXIV2, but I wasn't sure it belonged to JPEG Comment. Are you in a hurry to implement this feature? I'd like to wait until the New Year holidays to add this feature.
In addition, please submit this PR to the dev
branch.
I will merge it into the master
branch after all the platforms and all the Python versions have been tested.
Maybe a better idea is to have the comment available as an attribute of Image, instead of get_comment()
?
Nearly everyone does not realise that JPEG Header comment != EXIF Comment.... It is also the responsilbity of any documentation to make sure the user knows this.
Making these kinds of issues very well documented and easy to manage by the programmer through your library is what makes libraries very popular and live a long time with many good contributors.
Slightly better documentation can save people months of heart-ache when they realise some information is there that should not be, or they think it's a bug
So in this case, it can lead to leaking information, personal data, identifying information, etc.. super important to have this I think, maybe another idea can be to have a
In the future, on another pull request - self.img.clear_all_metadata()
that clears
an idea..
Oh, I also wrote an API called img.clear_all()
before.
But I later realized that the meaning of all
was ambiguous, and that there were dozens of standards for metadata, of which I could only delete EXIF, IPTC and XMP. So I removed the API.
As you can see from the ExifTool documentation, there are too many types of image metadata. Exiv2 mainly supports three kinds of metadata: EXIF, IPTC and XMP.
People often only care about what kind of image metadata they see on their phones and computers.
For example, when I looked at your previous photo using the professional software Adobe Bridge
, the metadata displayed was empty, so I thought there was no metadata on the image.
Oh, I also wrote an API called
img.clear_all()
before. But I later realized that the meaning ofall
was ambiguous, and that there were dozens of standards for metadata, of which I could only delete EXIF, IPTC and XMP. So I removed the API.
Yeah ok, agreed, well, in 99% of cases just using the existing libexiv2 functionality for handling comments would be really wonderful, looking forwards to seeing this pull request merged..
@LeoHsiao1 Please remove Can't read/write image structure which is not metadata, such as JPEG Comment
from the README.md
...
Oh, I'll update the document after I merge this PR into the master branch.
I've written the API for JPEG Comment and I'm writing the test case now. I will also check the ability to read and write ICC profile in the image, so I cannot release a new version today.
@LeoHsiao1 You've completely confused me again - there is already def test_modify_jpeg_header_comments():
... ?
Are you using the actual code from peoples pull requests or are you just rewriting it entirely??
Although you have done most of the work, there is still something to be done. For example:
encoding
in set_comment()
, resulting in unsupported Unicode characters.(*img)->writeMetadata();
in set_comment()
, resulting changes will not be saved to the image.@LeoHsiao1 I've written the API for JPEG Comment and I'm writing the test case now.
... I'm completely confused! I've already written this as part of this pull request !?!?!?
OK! Got it, sorry man, If you add a little more information in your comments it helps a lot! thanks again
Thank you for your work. It was only during the test that I found your code needed to be modified.
I just found out that I can add Comment
to a PNG image, but I can't see it with exifTool.
This pull request has been automatically closed because there has been no activity for a month.
As well supported by the
libexiv2-dev
interface, support for the JPEG Header comment field, technically this is also metadata :+1:I'm testing/building like this on Ubuntu/Debian, python3.6