Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saved images are very large #62

Closed
dadler opened this issue Apr 20, 2012 · 1 comment
Closed

Saved images are very large #62

dadler opened this issue Apr 20, 2012 · 1 comment

Comments

@dadler
Copy link
Owner

dadler commented Apr 20, 2012

When saving an image using Thumbnail Zoom Plus' hotkey or right-click "Save Enlarged Image As..." option, the resulting image file is often much larger than the original file you'd get using Firefox's Safe Link As or Save Page. The format is also always PNG, even if the user names the file ending in .jpg, and even if the source file was a jpg.

What's happening is that the original image is being rendered to an off-screen area (a "canvas") and then saved from there to PNG format, apparently with little or no compression. I don't know why the original developer did that rather than simply saving the data of the raw image directly (which would give the exact same file size, quality, and format as the original). Perhaps the goal was to convert images in arbitrary formats to a single consistent format for easier image manipulation later. But it has a big cost in file size.

It'd probably be better to save the original file as-is without re-encoding. It's potentially useful to supporting converting formats, but with the default being "no conversion".

Until this is fixed, a workaround is to use 1.6.1beta9 (or newer) and press the "t" to open the full-size image in a new tab. Then press Control-s (command-s on mac) to save the image; then close the tab.

Reported by rebyc on addons.mozilla.org.

@dadler
Copy link
Owner Author

dadler commented May 20, 2012

Background info:

The file picker code is in overlay.js::downloadImage().
The actual saving code downloadService.js.

About Downloading Files: https://developer.mozilla.org/en/Code_snippets/Downloading_Files

nsIWebBrowserPersist: https://developer.mozilla.org/en/nsIWebBrowserPersist

NSiDownloader: https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDownloader

Saving a URL to a local file: https://developer.mozilla.org/en/Code_snippets/Miscellaneous

@dadler dadler closed this as completed in 85247a8 May 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant