# Would it be worth resizing uploaded images (to save space)?

**URL:** https://meta.discourse.org/t/would-it-be-worth-resizing-uploaded-images-to-save-space/51901
**Category:** Feature
**Created:** [October 22, 2016, 6:35pm UTC](https://meta.discourse.org/t/would-it-be-worth-resizing-uploaded-images-to-save-space/51901 "2016-10-22T18:35:42Z")
**Posts on this page:** 1
**Showing post:** 23

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [April 25, 2019, 2:38pm UTC](https://meta.discourse.org/t/would-it-be-worth-resizing-uploaded-images-to-save-space/51901/23 "2019-04-25T14:38:55Z")

</div>

The script is [downsize\_uploads.rb](https://github.com/discourse/discourse/blob/master/script/downsize_uploads.rb). Run it like so:

```plaintext
cd /var/www/discourse
RAILS_ENV=production bundle exec ruby script/downsize_uploads.rb

```

It will try to downsize images to be 1 megapixel or less, or you can pass in the max size you want.

> [@Tom\_Newsom](#):
>
> I’d love to be able to shrink all \>1 year old images

The script doesn’t scope it like that, but you can easily edit the script to do so. Add `.where('created_at < ?, 1.year.ago)` to the [query on line 10](https://github.com/discourse/discourse/blob/master/script/downsize_uploads.rb#L10).

---

_[View the full topic](https://meta.discourse.org/t/would-it-be-worth-resizing-uploaded-images-to-save-space/51901)._
