tannerhelland / PhotoDemon

A free portable photo editor focused on pro-grade features, high performance, and maximum usability.
https://photodemon.org
Other
1.3k stars 192 forks source link

Increase max image dimensions allowed by resize tools #519

Closed tannerhelland closed 5 months ago

tannerhelland commented 5 months ago

Relates to #514 . Thank you to @pstein for suggesting this.

PhotoDemon is 20+ years old at this point (sigh) and vestiges of its early years sometimes show up in the source code. Hard-coded image resize limits of 32760 in either dimension was one of those vestiges.

I have changed this limit to a (still-arbitrary) 100,000 pixels in either dimension, but note that this is really only going to work for images that are ~1000-2000 px in the other dimension due to the inherent memory limitations PhotoDemon has as a 32-bit app. (@pstein suggested that stitched screenshots could be one such example of a "short in one direction but very long in the other" image, and indeed those should work quite well in PD.)

Still to-do is figuring out how this affects various image formats when exporting. Many image formats have dimension limits well below 100k (JPEGs have a 65k limit in either direction, for example), and PD does not currently validate this. I have added "export size verification on a per-format basis" to my TODO list.