Skip to content

bryceknz/delete-low-res-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

delete-low-res-images

I wrote this script πŸ“œ to automate deleting πŸ’€ images πŸ–ΌοΈ under a given resolution. I took a data dump πŸ’Ύ of all of my Google Photos content from 2016 when I went travelling πŸ₯Ύ and uploaded all my images πŸ“Έ in "Original Resolution". Not wanting to increase this quota πŸ’Έ, or lose the full-res versions of my images, I decided to backup πŸ“₯ what I could, then recover my storage space.

To use this script, simply replace the values for directory, resolutionLimit, and acceptedFiletypes (in lowercase) in index.js, then run npm start. All files equal to or under the resolutionLimit (in megapixels) will be deleted.


Note: If you run into this pesky error: TypeError: Corrupt JPG, exceeded buffer limits, I have a kludge...

Open index.js in node_modules/image-size/dist (I know, I know, I'm sorry), and alter the following line:

const MaxBufferSize = 512 * 1024;

to

const MaxBufferSize = 1024 * 1024;

This has fixed all my buffering issues, but your mileage may vary.

About

Delete files below a certain resolution.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published