-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Incorrect image size determination with inferRemoteSize()
or inferSize=true
when JPEG image has specific metadata
#12530
Comments
Can you please provide a valid reproduction? The one you shared is empty |
Hello @kadykov. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
The repro isn't empty, it's a remote address in |
@ematipico The minimal reproduction example contains only this code:
The output is rendered here as:
|
I found this comment in jpeg reader, that could explain this bug:
|
The issue was resolved by correcting the handling of non- I am confused about the warning in the header regarding incorrect handling of the SOF marker when it falls outside of the 4096-byte buffer size. In the example file, the metadata size is approximately 68.4kB, and the code correctly determines the image dimensions. I wonder if the warning is outdated or if there is a specific scenario where the code would fail to handle the SOF marker correctly. Could someone please clarify the purpose of this warning and whether it is still relevant? |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When using
astro
to generate a static site, I've encountered an issue where the size of remote images is incorrectly determined usinginferRemoteSize()
or by passinginferSize=true
to theImage
orPicture
component.In the minimal reproducible example, a sample photo with a size of 3730 x 5535 pixels is incorrectly reported as 48719 x 62538. This causes the
Picture
orImage
image optimization to fail with the error "Processed image is too large for the HEIF format".I've tried adjusting export options in Darktable, such as resolution, color space, and applied effects, but the reported image size remains incorrect. However, if I remove all metadata from the image, the size is correctly determined.
It appears that specific metadata in the JPEG file is conflicting with the way
inferRemoteSize()
determines image size.What's the expected result?
inferRemoteSize()
andinferSize=true
should correctly determine the image size, regardless of metadata.Link to Minimal Reproducible Example
https://github.com/kadykov/astro-image-size
Participation
The text was updated successfully, but these errors were encountered: