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

Bypass lazy loading for blob images (infragram uploads) #10210

Closed
jywarren opened this issue Sep 28, 2021 · 3 comments · Fixed by #10211
Closed

Bypass lazy loading for blob images (infragram uploads) #10210

jywarren opened this issue Sep 28, 2021 · 3 comments · Fixed by #10211

Comments

@jywarren
Copy link
Member

We have a category of images which are saved as "blobs" forwarded from another website of ours, https://infragram.org - and this breaks our "lazy loading" optimization of images. Let's just turn off lazy loading for this "card" display and it should resolve, although we could later introduce a conditional to detect this type of image.

https://publiclab.org/tag/infragram-upload

#8043 (comment)

Screen Shot 2021-09-28 at 11 21 49 AM

The code segment to revert is here:

https://github.com/publiclab/plots2/pull/8043/files/ab08fe9efa1723f4980e471d68081f05524fa49e#diff-ec08e67cfb3992bd8df01f2904b6dd82680df1e272a7d1d9a941900db40f409eL3

Really just the entire app/views/notes/_card.html.erb file.

@jywarren
Copy link
Member Author

Noting this type of image does display in the Wayback machine:

https://web.archive.org/web/20200314104929/https://publiclab.org/notes/biozanco/01-23-2020/ndvi-blue-filter-morus-nigra-leave

and you can see that it actually has the filename "blob" - but seems to be stored like a normal file:

<a class="main-image" style="max-width:100%;width:800px;" href="/web/20200314104929/https://publiclab.org/system/images/photos/000/037/745/original/blob">
--
  | <img style="max-height:600px;max-width:100%;" class="rounded d-none d-lg-inline" src="/web/20200314104929im_/https://publiclab.org/system/images/photos/000/037/745/original/blob"/>
  | <img style="width:100%;" class="rounded d-lg-none" src="/web/20200314104929im_/https://publiclab.org/system/images/photos/000/037/745/original/blob"/>
  | </a>

So the problem may be that it's actually just a JPG but it has the name "blob" instead of, say, "blob.jpg"

@jywarren
Copy link
Member Author

Yes, AND,

https://storage.googleapis.com/publiclab-production/public/system/images/photos/000/044/103/original/blob actually works -- just not the other sizes!

So we should be able to filter for filename "blob" and just only display the original size.

@jywarren
Copy link
Member Author

OK, tried that conditional on both note show pages and card display. I guess we should do wiki pages too... hang on...

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 a pull request may close this issue.

1 participant