Skip to content

Commit

Permalink
Merge pull request #3 from memeller/storage_access_bug_fix
Browse files Browse the repository at this point in the history
modified readme, added changelog and preview
  • Loading branch information
memeller authored Jan 22, 2023
2 parents b2ae73f + 7584a2b commit c23cfa2
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 12 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

## v5.2

- Fixed a bug, where the extension settings were ignored and resampling was in fact turned off for all images. This is the main cause of images looking bad after resize.
In background.js the settings were loaded into options, and then incorrectly accessed. Changing in background.js from

exif: options.exif,
to

exif: options['options.exif'],

i.e. accessing each option through full key e.g. "options.exif" fixed the problem. I am not sure if the way of accessing the storage has changed recently or if this was wrong from the beginning
- Added PNG to Exif header detection. Due to options reading bug the Exif module was not used previously and I did not see the "Not a JPEG" exception when adding PNG files. Apart from checking the correct magic bytes nothing more was added to Exif module, so probably copying PNG Exif data will not work.
- Fixed a bug, where the "Automatically rotate images" option could not be selected. This was cause by using options.orient instead of options.orientation in one place of config.js.
- Changed extension id, added readme and changelog

## Added in previous commits

- PNG Support
- PL lang support
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
See http://darktrojan.github.io/shrunked/ for information about contributing or localizing.
# Shrunked Image Resizer

[This is a fork of add-on by Geoff Lankow](https://github.com/darktrojan/shrunked)
Since the original repo is no longer mantained and became read-only on 28th of December, I've decided to continue my small improvements to this fantastic extension here.

## About this extension

After installing each time a compatible (JPG/PNG) image is attached to/inserted into new e-mail the user has the ability to resize the image. The resized image replaces previously inserted / attached one.

## New in this fork (vs darkrojan's version):

- Added PL lang support,
- PNG support,
- "Automatically rotate images" can now be checked - there was an issue with parameter name which caused the option to be permanently disabled,
- Resampling finally works
A bug caused the resampling process being permanently disabled, even though it was turned on in options.
Png from [w3c.org](https://www.w3.org/TR/dpub-latinreq/images/ImageCaptionRunaround.png) (2056x1432px) resized to 500px width:
![jpg preview](/images/preview.jpg)

## Known issues

- current resampling algorithm does not support alpha channel when resizing transparent PNG
Binary file added images/preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 6 additions & 11 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,26 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "5.1",
"version": "5.2",
"applications": {
"gecko": {
"id": "shrunked@darktrojan.net",
"id": "shrunked@mllr.pl",
"strict_min_version": "98.0",
"strict_max_version": "102.*"
}
},
"author": "Geoff Lankow",
"homepage_url": "https://github.com/darktrojan/shrunked",
"author": "Geoff Lankow, memeller",
"homepage_url": "https://github.com/memeller/shrunked",
"icons": {
"16": "content/icon16.png",
"32": "content/icon32.png",
"64": "content/icon64.png"
},
"default_locale": "en",
"background": {
"scripts": [
"background.js"
]
"scripts": ["background.js"]
},
"permissions": [
"compose",
"storage"
],
"permissions": ["compose", "storage"],
"options_ui": {
"page": "content/config.xhtml"
},
Expand Down

0 comments on commit c23cfa2

Please sign in to comment.