Is it possible to physically resize an image (i.e., the image file itself) automatically with Quarto website? #11794
-
DescriptionWhen inserting a figure into a Quarto website, it gets resized automatically, which is great, however, if I am not mistaken, this is only a resize on the client side, i.e., the whole image file itself is physically transferred, irrespective of its size. This is not really fortunate if I have a 100 MB image with a width of say 25,000 pixel. For display purposes on a website, I don't think we ever need more than 1200 width, or perhaps 1920 at most, so this is very inefficient. I could manually resize every image, but it'd much-much easier if we had a mechanism where Quarto, as a preprocessing step, would automatically resize images (i.e., the image files physically) to a maximum of 1200 or 1920 width, keeping the aspect ratio. This would be much more comfortable, as no manual resizing would be needed, the user wouldn't even need to keep track of the sizes. Hugo does this, but I don't know if this is possible with Quarto, and if so, how. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
See https://quarto.org/docs/projects/scripts.html#pre-and-post-render to implement whatever pre-processing you want. This thread is a duplicate of: Note that I don't believe any tools actually downscale the images and not upload the original images. It creates thumbnails used as placeholder instead of the original images. That's not the same thing as forbidding images to be large which is what you are suggesting. |
Beta Was this translation helpful? Give feedback.
See https://quarto.org/docs/projects/scripts.html#pre-and-post-render to implement whatever pre-processing you want.
This thread is a duplicate of:
Note that I don't believe any tools actually downscale the images and not upload the original images. It creates thumbnails used as placeholder instead of the original images. That's not the same thing as forbidding images to be large which is what you are suggesting.