Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

fix: preserve dropped image attachments#3786

Open
shriram-svg wants to merge 1 commit into
BoostIO:masterfrom
shriram-svg:fix-issue-2847-preserve-dropped-images
Open

fix: preserve dropped image attachments#3786
shriram-svg wants to merge 1 commit into
BoostIO:masterfrom
shriram-svg:fix-issue-2847-preserve-dropped-images

Conversation

@shriram-svg
Copy link
Copy Markdown

Fixes #2847.

What changed

  • Detect dropped image files by extension as well as MIME type, so SVG files with missing/non-standard MIME types are still inserted as images.
  • Only run EXIF/canvas rotation for JPEGs. SVG, PNG, GIF, and other non-JPEG image files are copied as-is, preserving their original bytes and extension.
  • Generate new :storage/... attachment markdown with POSIX separators so Windows drops do not insert backslashes into markdown image URLs.
  • Added a regression test for dropped SVG/PNG files.

Verification

  • npx --yes -p node@20 node node_modules/jest/bin/jest.js tests/dataApi/attachmentManagement.test.js --runInBand --testURL=http://localhost
  • npx --yes -p node@20 node node_modules/eslint/bin/eslint.js browser/main/lib/dataApi/attachmentManagement.js tests/dataApi/attachmentManagement.test.js
  • git diff --check

Notes:

  • yarn install --frozen-lockfile is blocked by the legacy lockfile's git://github.com/adobe-webplatform/eve.git#eef80ed dependency, which Yarn v1 cannot resolve from advertised refs. I used npm install --package-lock=false --ignore-scripts --legacy-peer-deps for local verification without committing dependency metadata.
  • Full npm run jest -- --runInBand --testURL=http://localhost still has existing unrelated storage lookup failures in createNote, deleteFolder, createNoteFromUrl, createFolder, and find-storage; the updated attachmentManagement suite passes.
  • Full npm run lint -- --quiet still fails on existing project-wide styleName/prettier errors unrelated to these files; ESLint passes on the touched files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

svg images are converted to png automaticly in 0.11.13

2 participants