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
Address out of order compatibility brands in Filetypebox of heif files #401
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. Can we please add test images to assert these fixes, and to prevent any regressions in the future 🙏🏽
Quality Gate passedIssues Measures |
what I've done in order to achieve the tests is somewhat hacky, I'll admit. I didn't know how to generate the actual images that would correspond to these conditions, so I manually edited the type boxes of a .avif version of sample.png I created with sharp. The way I discovered this condition is from an image in astro's tests. Here's the original image and I looked at how this images type box was structured and recreated it. All of the test files I added have a very similiar structure, the only difference is to test each condition I changed the second brand. They all are structured like this: @netroy Hopefully this makes sense and is viable in your opinion I am happy to rework / make any changes you'd like. Thank you |
I've been trying to find a way to create these images properly using a reliable tool. but no luck so far, as no tool lets us define the brands. The manually edited files look okay at a first glance, but the BTW, I've rebased this on the |
I will try to do the same, I am not too shocked to hear this didn't work I wish I could figure out how the original light_walrus.avif was created, but I'll try to also do some research we can also use |
Changes
/lib/types/heif.ts
heif.ts
relies on the first brand in the FileTypeBox, but for example some .avif images do not have "avif" as the first type in their FileTypeBox18.4
which shouldn't cause any problems as far as I am aware