Skip to content

fix: serve staged image formats - #16

Open
SulimanAbdulrazzaq wants to merge 1 commit into
Deepender25:mainfrom
SulimanAbdulrazzaq:agent/fix-image-content
Open

fix: serve staged image formats#16
SulimanAbdulrazzaq wants to merge 1 commit into
Deepender25:mainfrom
SulimanAbdulrazzaq:agent/fix-image-content

Conversation

@SulimanAbdulrazzaq

Copy link
Copy Markdown

Fixes #15.

Summary

Image items created from files retain their original extension when staged (.jpg, .webp, .gif, and others), but the edgelocal:// handler always looked for <imageId>.png. The preview request therefore returned 404 for non-PNG images.

This change resolves an image ID to the actual staged file, returns the matching MIME type, and keeps resolution confined to the images directory and supported image extensions. Clipboard screenshots stored as PNG continue to use the same path.

Tests

  • added resolver coverage for a staged JPEG, the existing PNG path, and malformed/path-like IDs
  • npx vitest run tests/imageProtocol.test.ts — 3 passed
  • npm run typecheck — node and renderer checks passed
  • npm run build — Electron main, preload, and renderer builds passed

The repository's committed package-lock.json is currently out of sync with package.json, so npm ci fails before installation on missing Electron signing/esbuild entries. Local dependencies were installed with lockfile writes disabled; this PR does not change the lockfile.

The full configured Vitest run has 5 passing and 4 failing tests. All four failures are pre-existing assertions in tests/geometry.test.ts that do not account for the current resolvedDisplay return field/fallback behavior; no geometry files are changed here.

@SulimanAbdulrazzaq

Copy link
Copy Markdown
Author

Hi @Deepender25, when you have a chance, could you please review this PR? Thank you.

@Deepender25

Copy link
Copy Markdown
Owner

@SulimanAbdulrazzaq i am really sorry i wasn't able to respond to this i was little busy with some other things.
i really appreciate your contribution and its a great help i have already incorporated this pr to the project and just kept on working with other things and app translation to multiple language and trying to make the apps experience as good as i can and those thing will be out really soon as i am free with the translation and testing part and your contribution have already a part of the next update and they will be out so don't worry.

msc3cssk-ioxmgcbo again thanks for your contribution and support

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.

[BUG]: pictures empty content message.

2 participants