Skip to content

eeeps/exif-resolution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

exif-resolution

A lil’ script to scale images for the web using Exif.

Requires exiftool.

Usage

Target dimensions

% node exif-resolution img.jpg 400x300

No matter what img.jpg’s actual pixel dimensions are, this will set its Exif metadata in such a way that browsers (well, some browsers) will give it an intrinsic size of 400-px-wide and 300-px-tall.

Target density

% node exif-resolution img.jpg 2x

You can also just give the script an image density. For example, if img.jpg is 800 × 600, this command is equivalent to the previous one. Both will cause browsers to give the image a .naturalWidth of 400, a .naturalHeight of 300, and an intrinsic density of 2x.

About

A lil' script to scale images for the web using EXIF

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published