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

Update free_functions.rs #2408

Merged
merged 2 commits into from
Jan 27, 2025
Merged

Update free_functions.rs #2408

merged 2 commits into from
Jan 27, 2025

Conversation

neckaros
Copy link
Contributor

Support guessing AVIF image generated by this library (with native avif)

Exemple of image generated by this library with the magic bytes not yet recognized:
image.zip

Support guessing AVIF image generated by this library (with native avif)
@fintelia
Copy link
Contributor

The array size needs to be updated, but otherwise looks good to me

@neckaros
Copy link
Contributor Author

The array size needs to be updated, but otherwise looks good to me

You are right my bad I will update it

@neckaros
Copy link
Contributor Author

I ran the test locally and the failing test do not seem related to my commit but I could be wrong?

@fintelia fintelia merged commit 1d64ce6 into image-rs:main Jan 27, 2025
26 of 32 checks passed
@fintelia
Copy link
Contributor

Thanks!

@kornelski
Copy link
Contributor

These bytes before ftyp are the size of the ftyp chunk. This chunk contains a variable-length list, so it could have any size.

Instead of collecting implementation-specific lengths, can the length be allowed to be any bytes? The two most significant bytes could be required to be 0, since the chunk is unlikely to ever exceed 64K.

@neckaros
Copy link
Contributor Author

These bytes before ftyp are the size of the ftyp chunk. This chunk contains a variable-length list, so it could have any size.

Instead of collecting implementation-specific lengths, can the length be allowed to be any bytes? The two most significant bytes could be required to be 0, since the chunk is unlikely to ever exceed 64K.

I wondered it myself but could not see how to do it with the current implementation

@kornelski
Copy link
Contributor

A simple solution could be to add a start offset to the table of magic strings, and skip 4 bytes in AVIFs case.

@fintelia
Copy link
Contributor

If we included a mask of bytes to ignore, we could also have an actual fix for #660

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

Successfully merging this pull request may close these issues.

3 participants