fix: serve staged image formats - #16
Open
SulimanAbdulrazzaq wants to merge 1 commit into
Open
Conversation
Author
|
Hi @Deepender25, when you have a chance, could you please review this PR? Thank you. |
Owner
|
@SulimanAbdulrazzaq i am really sorry i wasn't able to respond to this i was little busy with some other things.
again thanks for your contribution and support
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #15.
Summary
Image items created from files retain their original extension when staged (
.jpg,.webp,.gif, and others), but theedgelocal://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
npx vitest run tests/imageProtocol.test.ts— 3 passednpm run typecheck— node and renderer checks passednpm run build— Electron main, preload, and renderer builds passedThe repository's committed
package-lock.jsonis currently out of sync withpackage.json, sonpm cifails 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.tsthat do not account for the currentresolvedDisplayreturn field/fallback behavior; no geometry files are changed here.