Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMAGING-340] Support PNG extension #269

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

Glavo
Copy link
Contributor

@Glavo Glavo commented Jan 13, 2023

I hope to support Extensions to the PNG 1.2 Specification, Version 1.5.0 in this PR and be ready to support the APNG file format in subsequent PR.

Completed works:

  • Add an enum representing the PNG extension type;
  • Refactoring PngImageParser::readChunks and ChunkType to improve maintainability makes it easier to add new Chunk types later;
  • Support reading EXIF from PNG images.
  • Merge EXIF into PNG metadata;

@garydgregory
Copy link
Member

FYI, this will not be considered without unit tests.

@Glavo
Copy link
Contributor Author

Glavo commented Jan 13, 2023

FYI, this will not be considered without unit tests.

Before that, I need to find a way to generate test data.
The new extension lacks tool support. I think I may need to use libpng directly to generate test data.

@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2023

Codecov Report

Merging #269 (4f0dcfb) into master (3542407) will decrease coverage by 0.08%.
The diff coverage is 62.50%.

@@             Coverage Diff              @@
##             master     #269      +/-   ##
============================================
- Coverage     70.76%   70.67%   -0.09%     
- Complexity     3368     3377       +9     
============================================
  Files           332      334       +2     
  Lines         16936    16991      +55     
  Branches       2652     2651       -1     
============================================
+ Hits          11985    12009      +24     
- Misses         3904     3927      +23     
- Partials       1047     1055       +8     
Impacted Files Coverage Δ
.../commons/imaging/formats/png/PngImageMetadata.java 25.00% <25.00%> (ø)
...he/commons/imaging/formats/png/PngImageParser.java 59.75% <64.00%> (-3.02%) ⬇️
.../apache/commons/imaging/formats/png/ChunkType.java 93.61% <91.66%> (-6.39%) ⬇️
.../apache/commons/imaging/formats/png/Extension.java 100.00% <100.00%> (ø)
...he/commons/imaging/formats/tiff/TiffDirectory.java 30.15% <0.00%> (+0.52%) ⬆️
...ommons/imaging/formats/tiff/TiffImageMetadata.java 29.08% <0.00%> (+0.79%) ⬆️
...n/java/org/apache/commons/imaging/ImageParser.java 40.47% <0.00%> (+1.19%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Glavo Glavo changed the title [WIP] Support PNG extension [WIP] [IMAGING-340] Support PNG extension Jan 13, 2023
@Glavo
Copy link
Contributor Author

Glavo commented Jan 13, 2023

When I created the test, I noticed the type of EXIF_TAG_EXIF_IMAGE_WIDTH and EXIF_TAG_EXIF_IMAGE_LENGTH is TagInfoShort.

However, in the standard document, the field type is SHORT or LONG.

Unfortunately, the test image I found uses the LONG type field to record ExifImageWidth and ExifImageLength, so I found this problem.

Should I solve this problem in this PR? Or do I need to open a new PR?

@Glavo Glavo changed the title [WIP] [IMAGING-340] Support PNG extension [IMAGING-340] Support PNG extension Jan 13, 2023
@Glavo
Copy link
Contributor Author

Glavo commented Jan 15, 2023

I updated this PR, followed the requirements of IMAGING-341, and recorded the standard version in the document.

Can someone review this PR?

Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a initial look @Glavo , I left a few comments, if you could reply/update it, I'll have a final look with the IDE and then review/merge it 👍 Thanks!

* and supports the following extensions:
* <ul>
* <li><a href="http://ftp-osl.osuosl.org/pub/libpng/documents/pngext-1.5.0.html">Extensions to the PNG 1.2 Specification, Version 1.5.0</a></li>
* </ul>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👏

} else {
result.add(new PngChunk(length, chunkType, crc, bytes));
}
result.add(ChunkType.makeChunk(length, chunkType, crc, bytes));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙆‍♂️ 👏 bravo, @Glavo

@Glavo
Copy link
Contributor Author

Glavo commented Jan 15, 2023

The javadoc has been updated to add the @since tag.

@StefanOltmann
Copy link
Contributor

@Glavo Thank you!

I don’t know if this PR will ever be pulled, because by now I think that this project is pretty much dead.

But you did not waste your time on this, because I pulled it into my Kotlin port Ashampoo Kim. So you may be glad to hear that your code is used in production (for example by Ashampoo Photos) and people benefit from it. 🙂

I invite you to contribute directly to my fork in the future.

@kinow
Copy link
Member

kinow commented Feb 27, 2024

I don’t know if this PR will ever be pulled, because by now I think that this project is pretty much dead.

Certainly not dead. Maintained by volunteers, yes. I am busy with deadlines at work, but watching and planning a future development cycle, fix security bugs (a lot happens there without activity on GitHub for a reason, so again, not dead).

I think it is good to have more projects like what you created to give more options to users.

But leave a comment saying a project is dead and promote your own tool doesn't look very good, IMHO.

And apologies again for the radio silence, just busy with $work and not able to volunteer time at this point (happy if any other committer takes over, otherwise March I should be available).

Cheers

@StefanOltmann
Copy link
Contributor

@kinow

Thank you for reaching out and providing an update.

I must admit, I've encountered some frustration recently. Over the past few months, the only noticeable activity on the project seems to be from Gary, who has been addressing minor style issues but not significantly contributing otherwise. It appears he hasn't been thoroughly reviewing code in pull requests and may not grasp the project's domain.

Even without unit tests, confirming the correctness of the bugfix in my pull request or validating the provided test should have been straightforward for someone familiar with the codebase and its intricacies. This is the kind of scrutiny and understanding that someone actively engaged in the project could provide.

I recall observing this level of engagement from you some time ago, which is why I directed my concerns to you.

Maybe the project isn’t dead, given the abundance of open issues and pull requests coupled with the lack of substantial development, it's difficult to characterize it as an actively progressing endeavor.

I am glad to hear that you plan to pick up the work here, because this project deserves real maintenance.

How Gary acts on my PRs is just ridiculous. First he wanted me to include a test image and provide a test - both would not have been necessary. After I did go the extra mile he doesn’t want the test (because he does not seem to understand what it does) and now all of the sudden the inclusion of the test image is a problem. That’s really sad and ridiculous maintenance. I believe this projects deserves better.

@kinow
Copy link
Member

kinow commented Feb 27, 2024

I understand the frustration @StefanOltmann , and I am sure there are ways to improve how we interact here (on both ends, including myself). I have not followed everything that's happening due to these $work projects/deadlines, but I will try to catch up with everything that is happening and slowly start to review issues and pull requests, and also fix the security warnings we have.

Feel free to ping me in issues/pull requests if you'd like, just expect some delays until the end of this month 👍 And as for your interaction with Gary/others, please consider that they are trying to help as I was the last person more actively working, but I have been away for some months now (apologies, again). They are trying to help as much as they can, and there can be some misunderstanding, but finding a way to work well and communicate your frustrations clearly and politely is key -- not only for ASF, but for your own personal open source projects 👍

@garydgregory
Copy link
Member

This component is definitely not dead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants