You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We detected three major problems within the Amperize repository:
Images without extension
Images like this https://www.zomato.com/logo/18163505/minilogo work, but don't have an extension and will therefore cause an error in the underlying image-size library.
One image fails all
If one image fails to load, none are loaded. This is simple to test by adding an image (open amp page) then add another image with a made up name and view the amp page again. Both images are missing.
✋ Waiting for reply of repository owner about further maintaining. This will decide, if we'll start forking and use the fork as dependency, or continue with the original repository (but with possible merge rights)
Note: I created a new repository which is fixed the above mentioned issues. It is possible to either port those changes to the Amperize repository, my fork of it, or using the new repository. All dependent on how the repository owner plans to keep maintaining it or not.
The text was updated successfully, but these errors were encountered:
closesTryGhost#9022
Images without extensions don't need to be manipulated, as we're now reading the bytes and pass those to the `image-size` lib.
This PR adds another `user-agent` to emulate multiple browser requests, as I stumbled over an example where the image without extension is protected otherwise.
Added a test, that works with above mentioned image, but is currently mocked. Nevertheless, the image worked as a PoC, that we're able to read the bytes of an image without its extension and still return the dimensions of the image.
closes#9022
Images without extensions don't need to be manipulated, as we're now reading the bytes and pass those to the `image-size` lib.
This PR adds another `user-agent` to emulate multiple browser requests, as I stumbled over an example where the image without extension is protected otherwise.
Added a test, that works with above mentioned image, but is currently mocked. Nevertheless, the image worked as a PoC, that we're able to read the bytes of an image without its extension and still return the dimensions of the image.
Issue Summary
We detected three major problems within the Amperize repository:
Images without extension
Images like this https://www.zomato.com/logo/18163505/minilogo work, but don't have an extension and will therefore cause an error in the underlying
image-size
library.One image fails all
If one image fails to load, none are loaded. This is simple to test by adding an image (open amp page) then add another image with a made up name and view the amp page again. Both images are missing.
Redirects are not followed
Redirected image URLs are not followed. Within Ghost (where we use a similar logic to fetch image dimension), we fixed this by changing to
got
for our requests. See 🙈 Usedgot
to handle requests for image-size #8953 and the follow up PR ✨ Request util to wrapgot
library #8980.Todos/Sub-issues
image-size
library jbhannah/amperize#97Note: I created a new repository which is fixed the above mentioned issues. It is possible to either port those changes to the Amperize repository, my fork of it, or using the new repository. All dependent on how the repository owner plans to keep maintaining it or not.
The text was updated successfully, but these errors were encountered: