# Unable to resize images after uploading

**URL:** https://meta.discourse.org/t/unable-to-resize-images-after-uploading/32183
**Category:** Bug
**Created:** [2015年八月16日 18:24 UTC](https://meta.discourse.org/t/unable-to-resize-images-after-uploading/32183 "2015-08-16T18:24:04Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2015年八月17日 16:59 UTC](https://meta.discourse.org/t/unable-to-resize-images-after-uploading/32183/3 "2015-08-17T16:59:22Z")

</div>

Ok, I’ve found the 🐛 . It happens that `IO.size` is cached and while we were actually downsizing the image, the algorithm was always checking the same file size… Thus resulting in an error when uploading a file larger than the image size limit…

[https://github.com/discourse/discourse/commit/827ea641b04396e2cc3f5c8298c3ad475b1a4eff](https://github.com/discourse/discourse/commit/827ea641b04396e2cc3f5c8298c3ad475b1a4eff)

---

_[View the full topic](https://meta.discourse.org/t/unable-to-resize-images-after-uploading/32183)._
