Skip to content

chore(preprod): Save images as original file format to ParsedAssets#2859

Merged
NicoHinderling merged 2 commits intomasterfrom
nico-wip-original-file-protecting
Oct 21, 2025
Merged

chore(preprod): Save images as original file format to ParsedAssets#2859
NicoHinderling merged 2 commits intomasterfrom
nico-wip-original-file-protecting

Conversation

@NicoHinderling
Copy link
Copy Markdown
Contributor

ParsedAssets currently contains all the images we extracted but they are all saved as PNGs. We want to keep them in their original format to make sure that our image insights are as accurate possible, and having them converted to PNG can disrupt this

Appears to work and be processed by launchpad correctly from local testing

cursor[bot]

This comment was marked as outdated.

@NicoHinderling NicoHinderling force-pushed the nico-wip-original-file-protecting branch from aed7bd9 to 1a589db Compare October 20, 2025 22:22
cursor[bot]

This comment was marked as outdated.

case "bmp":
return UTType.bmp.identifier
default:
return UTType.png.identifier
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be more defensive? I'd like it to only handle types that we know, otherwise return nil as an optional.

images[imageId] = unslicedImage

let fileExtension = (renditionTypeName as NSString).pathExtension.lowercased()
let originalFormat = fileExtension.isEmpty ? "png" : fileExtension
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, perhaps skip over files that don't have an extension.

@NicoHinderling NicoHinderling merged commit a47babb into master Oct 21, 2025
27 checks passed
@NicoHinderling NicoHinderling deleted the nico-wip-original-file-protecting branch October 21, 2025 00:56
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.

2 participants