Repository navigation
Big release for memory usage! An 8 megapixel JPEG was using nearly half a gig to decode 😂 The progressive decoder was hanging on to every block's DCT coefficients while it put together the full image, but it can now finish a row of blocks and reuse that space for the next row. Baseline JPEGs get the same treatment.
One thing to watch when upgrading from 0.4.1. The default decode limit is now 8,000,000 pixels, so a 4000×3000 photo will raise PureJPEG::DecodeError. If you meant to read a photo that big, pass the limit on that call, as so:
PureJPEG.read("photo.jpg", max_pixels: 12_000_000)Decoder.new and Decoder.decode take max_pixels: as well. A 8192 pixel limit on width and height still applies. If all you need is the size, PureJPEG.info(path) works above the pixel limit and now stops reading the file when it reaches the first scan marker.