Comments (7)
For anyone else interested in this issue, or who wants to know part of how g-image
works, here's some of what I've found out so far:
- When you pass a string into the src attribute on the g-image component, that src string gets processed and turned into an object containing a bunch of info about the image, including a small version of the image as a data URI.
How the image processing works:
- When you pass a string into the
g-image
component, a custom Webpack loader (assets-loader
) is called, which adds the image to a queue for processing. - The processing of the image is done by the
preProcess
method in theImageProcessQueue
(found inlib/app/queue/ImageProcessQueue.js
)
I'll hopefully be digging into this more to figure out how I can get the Webpack loader to recognize the responsive
attribute, and pass it along to the preProcess
method to let it know to process the image at 2x.
from gridsome.
@issuehuntfest has funded $20.00 to this issue. See it on IssueHunt
from gridsome.
Concerning the retina support, the solution proposed in this issue #288 should do the trick.
from gridsome.
I'm trying to improve by tweaking ImageProcessQueue.js but I spent too much time understanding all the code.
I can't find where I could remove the upper limit for generated sizes without removing it for the intrinsic size too.
@tomtev, could you help me with that ?
I have already modified:
options.sizes || [480, 640, 768, 1024, 1366, 1600, 1920, 2560]
(but 2560 is never generated even if the width parameter is >= 2560
options.sizes || (max-width: ${imageWidth}px) 100vw, 50vw
; (because 50vw seems better than fixed width for larger viewports)
from gridsome.
@tomtev @hjvedvik, see above comment ☝️
from gridsome.
for now falling back to native:
<img src='@/assets/images/img-01.png', srcset='@/assets/images/[email protected] 2x' />
Note: While using <img />
tag, use @
don't use ~
else you will get error.
from gridsome.
Hello in 2021 all sites need retina.
Can you add this request in Gridsome roadmap?
from gridsome.
Related Issues (20)
- Dynamic pages using templates HOT 1
- error while using gridsome/vue-remark
- Load content within content container
- Gridsome i18n dynamic router with dot doesnt work HOT 1
- Gridsome is not really static and titles don't work when refreshing HOT 1
- Create a section that doesnt reload when you switch from page
- gridsome build stuck HOT 2
- how to use @gridsome/transformer-remark to marked
- An error which says "Failed to process image xxxx" happened when run gridsome build
- Google Analytics 4? HOT 1
- Will Gridsome continue to have support and updates? Or will it become a deprecated technology? HOT 4
- Gridsome build stucked
- Building with dynamically generated pages for tags fails.
- Google Tag Manager tag is not firing when viewing the page; we have to reload the page. HOT 1
- [remark-wiki-link] Warning: please upgrade to remark 13 to use this plugin
- Gridsome build error HOT 1
- Gridsome airtable requires update as API key will be depricated from Feb 2024
- Questions about adding properties to the page-query list HOT 1
- Is there a way to merge grid some into nuxt?
- Build error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gridsome.