Skip to content

[RFC] feat: allow to edit local Blob images - #85

Open
Antreesy wants to merge 3 commits into
mainfrom
fix/local-blob-editing
Open

Antreesy wants to merge 3 commits into
mainfrom
fix/local-blob-editing

Conversation

@Antreesy

@Antreesy Antreesy commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

  • Makes editing a local File or Blob work fully, with no server
  • Adds demo page (subject to change or remove) and documentation
Details

Fixed

  • A Blob without a type lost its format on export. Such a Blob (new Blob([bytes]), or a File with an extension the browser does not know) loaded fine, because browsers read the format from the bytes. The export only looked at blob.type, so a JPEG:

    • was saved as a PNG,
    • lost its EXIF, XMP and colour profile,
    • was never handed back untouched when nothing was edited.

    The export now reads JPEG, PNG and WebP from the first bytes when type is empty. No new prop or API.

  • The downscale dialog named a File "[object File]". It now uses the file name, or "This image" for a bare Blob.

Added

  • Playground demo for editing a local file: ?demo=local-file (playground/LocalFileDemo.vue). Pick a file, edit it, preview or download the result. It also shows how to handle cancel and error.
  • README section "Editing a local file", with a code sample and the behaviour for a Blob source: output format, untouched pass-through, untyped Blobs, object URLs, and corrupt input.

Checked, no change needed

  • The only object URL the editor makes (loadImage) is revoked in finally, on success and on failure. Tests for this already exist.
  • A corrupt or non-image Blob fires error and shows the retry. It never hangs.
  • PNG, WebP and an 8000Γ—6000 JPEG load and export correctly in Chromium and Firefox.

Demo:
https://deploy-preview-85--nextcloud-image-editor.netlify.app/?demo=local-file

Talk branch to test:
https://github.com/nextcloud/spreed/tree/feat/noid/edit-staged-images

A B
2026-11-20_15h20_49 2026-11-20_15h21_06
2026-11-20_15h21_17 2026-11-20_15h21_35

πŸ€– AI (if applicable)

  • The content of this PR was partly or fully generated using AI

The dialog for an image too large to edit named a File source
"[object File]". It now uses the file name, or "This image" for a bare
Blob.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
A Blob without a type decoded fine, as browsers read the format from
the bytes, but export decided everything on blob.type: a JPEG was saved
as a PNG, lost its EXIF and was never handed back untouched. The export
now reads JPEG, PNG and WebP from the first bytes where the type is
empty.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Adds a local-file demo to the playground (?demo=local-file), a README
section on editing a local file, and an e2e test that edits a picked
File and checks the Blob that comes back.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy
Antreesy requested a review from skjnldsv November 20, 2026 14:50
@Antreesy Antreesy self-assigned this Nov 20, 2026
@Antreesy Antreesy added the type: enhancement πŸš€ New feature or request label Nov 20, 2026
@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

βœ… Deploy Preview for nextcloud-image-editor ready!

Name Link
πŸ”¨ Latest commit 0530d66
πŸ” Latest deploy log https://app.netlify.com/projects/nextcloud-image-editor/deploys/6b005e4eb84fe98555977bbe
😎 Deploy Preview https://deploy-preview-85--nextcloud-image-editor.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
πŸ€– Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Nov 20, 2026
@codecov

codecov Bot commented Nov 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 4 lines in your changes missing coverage. Please review.
βœ… Project coverage is 45.33%. Comparing base (5a85764) to head (0530d66).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/components/ImageEditor.vue 0.00% 3 Missing ⚠️
lib/composables/useExportImage.ts 93.75% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #85      +/-   ##
==========================================
+ Coverage   45.07%   45.33%   +0.26%     
==========================================
  Files          57       57              
  Lines        5085     5113      +28     
  Branches      497      511      +14     
==========================================
+ Hits         2292     2318      +26     
- Misses       2790     2791       +1     
- Partials        3        4       +1     

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits type: enhancement πŸš€ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants