feat: reduce image crate features to PNG/JPEG baseline#2008
Conversation
Split `add_thumbnails` so it only enables PNG and JPEG by default. Add `image_gif`, `image_webp`, and `image_tiff` feature flags for opt-in support of additional thumbnail formats. Closes contentauth#1593
Questions for reviewers
|
|
What is the motivation for this? Do you want to reduce code size? Would it make sense to tie this thumbnail support with the support for the assoiciated asset types? |
|
@gpeacock In local release builds, enabling the extra thumbnail codecs increased the size of the Based on that, I kept PNG/JPEG in the baseline and made GIF/WebP/TIFF opt-in, so consumers who do not need those codecs do not pay that cost by default. I treated thumbnail codec support separately from asset-type support because my goal here was to make the extra codec cost opt-in at the thumbnail layer. That said, I agree this is also a feature-boundary question, and if tying it to associated asset support would be a better fit for the crate, I can rework the feature split in that direction. |
Split
add_thumbnailsso it only enables PNG and JPEG by default. Addimage_gif,image_webp, andimage_tifffeature flags for opt-in support of additional thumbnail formats.Partially addresses #1593
Changes in this pull request
add_thumbnailsnow only enables PNG/JPEG decoding and encodingimage_gif,image_webp,image_tifffeature flags that each enable the correspondingimagecrate featureThumbnailFormatenum variants (Gif, WebP, Tiff) and related match arms with#[cfg(feature = "...")]lib.rsChecklist
TO DOitems (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.