# Changing max\_image\_size\_kb

**URL:** <https://meta.discourse.org/t/changing-max-image-size-kb/247420>\
**Category:** Product Support\
**Tags:** uploads, s3\
**Created:** [December 2, 2022, 1:25am UTC](https://meta.discourse.org/t/changing-max-image-size-kb/247420 "2022-12-02T01:25:31Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![fearlessfrog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fearlessfrog/32/119653_2.png) [@fearlessfrog](https://meta.discourse.org/u/fearlessfrog)\
**Post date:** [December 2, 2022, 1:25am UTC](https://meta.discourse.org/t/changing-max-image-size-kb/247420/1 "2022-12-02T01:25:31Z")

</div>

We’re thinking of changing our setting for max image size kb, as we we started out with it quite high and need to save some S3 costs. I wanted to check my understanding before hitting the button.

I think this setting on setting only gets applied to new uploads? Is there a way to resize existing uploads to use the new max value (e.g. resize the originals of anything over the max)? I’m was sort of hoping something like `bundle exec rake posts:rebake` would do it (maybe)?

If that wouldn’t work, what’s the best approach here? An older build of discourse had a Rails [script/downsize\_uploads.rb](https://github.com/discourse/discourse/blob/4c89f7f88165c28bfc8ecb15a3be7346985d384e/script/downsize_uploads.rb) but I think that’s gone from github now? Is there anything else or is my best bet just to use that code on a more recent Discourse - I think it uses megapixel as the constraint rather than kb?

Thanks for any help/advice.

---

_[View the full topic](https://meta.discourse.org/t/changing-max-image-size-kb/247420)._
