Resizing images
See original GitHub issueWould you consider resizing images to be a part of the design goals of this module? It would be very convenient to keep original images in the project directory and in the importing code specify require('./images/my-photo.jpg?resize=1000px')}
. From my point of view, resizing images down is a similar semantically operation as minifying with mozjpeg. What do you think?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:21 (9 by maintainers)
Top Results From Across the Web
Free Image Resizer: Resize Photos Online | Adobe Express
Resize your photos easily with the Adobe Express free image resizer. Simply upload your pictures, change the photo size, and download your new...
Read more >Simple Image Resizer, resize online images without losing ...
Simple Image Resizer is free, online and powerful image resizer. Resize your images, photos, scanned documents without losing quality and in a easy...
Read more >Resize multiple images at once! - iLoveIMG
Resize multiple JPG, PNG, SVG or GIF images in seconds easily and for free. Bulk resize images by defining pixels or percentages.
Read more >PicResize - Crop, Resize, Edit images online for free!
The original FREE picture resize and crop tool since 2005! Resize, crop, compress, add effects to your images, photos, and screenshots for free!...
Read more >Free Online Image Resizer | Resize Photos Easily - BeFunky
It is the fastest way to edit your photos for all types of projects. Easily resize images by pixel dimensions, scale by percentages,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Version v2.2.0 has just been published which now supports image resizing. If you had responsive-loader previously installed, make sure to also update it to v1.2.0 (earlier versions won’t work correctly). Also, responsive-loader requires you to either install
jimp
(node implementation, slower) orsharp
(binary, faster).After adding the
?resize
query param, you can pass in any other available param of the responsive-loader to resize your image. Example:I hope that it works as you have expected, otherwise please tell me 😃
So, I think that I found an improvement for both use cases.
Specifying the size with resource queries
When you want to resize single images with the query param (e.g.
my-image.jpg?size=300
ormy-image.jpg?sizes[]=300&sizes[]=500
), you don’t need the?resize
prefix anymore (but it still works if you want it). Although if you need any other query of responsive-loader, you still need the resize prefix.Let responsive-loader handle all JPEG and PNG images per default
If you want all images to be resized with a global config (as of your use case @denis-sokolov), you can now overwrite the default loader with the
defaultImageLoader
option. All JPEG and PNG images will then directly be forwarded to the responsive-loader. But as this loader is more restrictive, the query params of next-optimized-images won’t work anymore (e.g. responsive-loader can’t handle inlined images etc.). But for all other types (SVG, WEBP and GIF), img-loader will still be used and the queries are still available there.I hope that this improves the experience for both use cases. Both changes are available in version
2.3.0
which has just been published to npm.