Exif support attempt number 2#242
Conversation
|
Hey, I saw your comment on #243 and had a look around in your code, where I saw you added generics to Image. In my pr #245, I also had a deep look at the Image struct and how it works with the decoder. Also, @fintelia said in multiple places that the encoding API needs an overhaul. Also in #222, someone agreed with me that private fields in the Image make inspection difficult. The main point is that I think that overhaul would mean using a more config/property type of design, rather than a generics design e.g. #205. I don't know what that would mean for this PR, and it should belong in its own PR, let's say we have these "problems":
Now, I think it would be a good idea to have three levels of wrapping structs that hold data: Additionally, I think the
It's getting all a bit messy now and I can't save drafts. Also should this be its separate issue/discussion? (big refactor + API overhaul) |
That's essentially what is being attempted here. The Directory type is now at the root and used in both encoder and decoder. However it expects to be tagged with the tiff format and that is wy generics are being passed down. I would sleep well knowing them gone, but this is a draft PR to see where this can be taken. I appreciate the amount of research that shows through your comment, but I am swamped at the moment and cannot reciprocate. Please do create a discussion and we can discuss the implementation there. |
|
Hey, thanks for your reply, I'll see if I can make a discussion tomorrow. I think harmonization is a bit different than exif and this PR addresses both and my PR also overhauls internal structures. So I made this comment to separate that, after gathering what is needed for exif support. As I understand, it's also not entirely clear, but at least the following:
Yes, and I'm suggesting 2 "types", images and "raw" ifds. Ill see if I can polish my post more better tomorrow.
In the decoder, this information is a boolean flag, rather than a generic. I think essentially bigtiffness should only have to be used when reading/writing tags or headers, after which this information is redundant (if we store everything in u64 in our structures). Also ""TileByteLength"" tag in bigtiff doesn't have to be u64 per se (I think it doesn't make sense, since you'd have a very weird tiled tiff if it has tiles so big they don't fit into u32, you've done something wrong with the tiling then), which the boolean-flag-design allows for more easily. |
|
This PR is far too large, with for too much all rolled up into it to meaningfully review. The proper way to add a big feature would be starting with an issue to discuss the proposed design, then if there is favorable reception for maintainers, making a series of moderately sized PRs to implement it. Though that also assumes sufficient maintainer bandwidth, which at the moment is stretched very thin. |
|
Why is #221 not closed then ? |
|
I don't fully recall the state of that other PR, but it is more than 5x smaller than this one. TBH I haven't figured out how to handle multi-thousand line PRs. Seems to be lose-lose regardless. Essentially every time I've tried to review such a large PR, it stalls out after several rounds of feedback, either because the author gets tired of making more and more changes (understandable!) or due to design disagreements that cannot be reconciled. Ends up being a waste of everyone's time and very demoralizing. On the other hand, other options aren't much better. Closing such a huge PR comes across as harsh given the work that went into it, but not closing is often mistaken as an encouragement to do more work. Requesting a PR to be broken into several pieces comes across as agreeing to all the feature changes. Leaving some PR feedback at the same time as one of these other options leaves very mixed messages. |
|
I get your point. It did seem unfair and preferrential, especially as this one is a draft for exposure on an experiment and not submitted for review. I want to add that the numbers are inflated by moving code around, but that does not change the ultimate point you rightfully make. @fintelia one of the first things I did in this PR is centralize code implemented in both the encoder and decoder. Would that be a worthwhile PR to look at ? |
|
Do you mean the "Created global ifd definition" change? Haven't looked in detail, but from skimming:
(Also reopening the PR, so we can continue in the same PR thread if we figure out how to pivot this to a sufficiently self contained change) |
d5bba7a to
ce3eb28
Compare
|
It's way too many conceptual changes at once for what it's trying to add (also causing that a need to rebase again and again). We can take individual PRs for each of
Please, factor your changes into individual units that can be invidiually looked at. I don't think the critique of that PR being too big was overstated or bloated by moving code around. It's just as bloated in concepts. For reference, take a look at the evolution of #229 as it incorporated feedback of simplification; and the even further reduction I managed to make before merging it; in terms of added concepts as well as dependencies. And it wouldn't hurt to update which part of EXIF handling this is addressing now that we have more general IFD-pointer handling. Seems like EXIF is now almost just a specialization of given infrastructure, so why did it take more lines? |
|
Thanks for the housekeeping, this PR was haphazard in the addition of someone else's code in an unfamiliar codebase, and I really appreciate the core concepts being merged in main. I plan on maybe adding an example of how I successfully, yet clunkily, manage exif tags with the new changes and we can discuss the above changes are the most suited to simplify/streamline the user experience. |
|
Yes that would be great 🎉 We have an |
Rebase @seaeagle1's PR and try to pull together multiple definitions of IFDs and entries. A lot has changed from the use of common structures.