Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AdvancedPaste] Add all supported image filetypes to ImageToText #35600

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

daverayment
Copy link
Contributor

Summary of the Pull Request

This removes the small list of supported image filetypes in AdvancedPaste's ClipboardHelper, replacing it with the full list of types obtained from BitmapDecoder directly.

PR Checklist

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

The current list of ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".ico", ".svg" is incomplete. This PR obtains a list of all supported extensions from the BitmapDecoder itself. The full list on my Windows 11 machine is:

.bmp
.dib
.rle
.gif
.ico
.icon
.cur
.jpeg
.jpe
.jpg
.jfif
.exif
.png
.tiff
.tif
.dng
.wdp
.jxr
.dds
.heic
.heif
.hif
.avci
.heics
.heifs
.avcs
.avif
.avifs
.webp
.3FR
.ARI
.ARW
.BAY
.CAP
.CR2
.CR3
.CRW
.DCS
.DCR
.DRF
.EIP
.ERF
.FFF
.IIQ
.K25
.KDC
.MEF
.MOS
.MRW
.NEF
.NRW
.ORF
.ORI
.PEF
.PTX
.PXN
.RAF
.RAW
.RW2
.RWL
.SR2
.SRF
.SRW
.X3F
.DNG
.JXL

This includes several RAW camera formats and some variations for types already marked as supported but not included in the hardcoded list (including ".jfif" and ".jpe" for JPEG files, for example).

Note: BitmapDecoder on my machine does not include a reference to SVG files, although this was explicitly included in the previous hardcoded list. I tested the existing code with several SVG files, and it resulted in an error for me, so I have not added it back in:

Screenshot 2024-10-25 222545

I assume that if SVG is added as a WIC codec, that it will be transparently supported in Image to Text via the new enumeration method.

Validation Steps Performed

This was tested manually by executing the Image to Text function on a number of different filetypes. I do not have an example file for every file format, unfortunately, but I have tested JPEG, GIF, PNG, BMP, TIFF and others, including less common types like AVIF and EXIF.

I also confirmed that if the user didn't have HEIC codecs installed that the function correctly logged an error, but did not surface this to the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant