Coder Social home page Coder Social logo

memeller / shrunked Goto Github PK

View Code? Open in Web Editor NEW

This project forked from darktrojan/shrunked

11.0 6.0 0.0 895 KB

Shrunked Image Resizer add-on for Thunderbird

Home Page: https://addons.thunderbird.net/addon/shrunked-image-resizer/

JavaScript 89.44% CSS 2.27% HTML 8.29%

shrunked's Introduction

Shrunked Image Resizer

This is a fork of add-on by Geoff Lankow
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

Each time a compatible (JPG/PNG/BMP) 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.

Installation

Head over to release page and download the xpi.
If you are using Firefox, you will need to right click on the link and select "Save link as...", otherwise Firefox will try to install the xpi file in Firefox.
Open Thunderbird, open Add-ons (Tools -> Add-ons and Themes), select "Install Add-on From File..."
install from file
and select the downloaded xpi.

How to use

After installing the add-on, some options are set by default. Please adjust the options if, for example, you want images to be resized in reply/forward mode.
png options
Each time you attach/insert an image into an email, a small notfication will appear asking if you would like to resize the image(s).
png options
If you select 'Yes', a small window will appear allowing you to set the target dimensions, see the size of the image before and after, etc.
png options
After confirming the resize, the attachments / inline images will be replaced with their resized versions.\

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

  • Added support for resizing images when forwarding / replying to messages. This can be enabled in the options, disabled by default.

  • Added Autoresize. This can be enabled for all images / inline only / attachments only. When enabled, each time an image is inserted / attached, the requirements for the resize function are checked (file size / dimensions, the ones set in options panel). If the image should be resized, it will be resized and replaced automatically, without any user interaction.

  • Added PL lang support,

  • BMP support (converted to JPG when resized),

  • 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 to be permanently disabled, even though resampling was enabled in options.

  • Added new resize algorithm, taken from https://github.com/taisel/JS-Image-Resizer. It is used by default, to use the previous algorithm please uncheck the corresponding option in the options panel. The new algorithm works with transparent PNGs, while the previous algorithm adds a black background to previously transparent PNGs when resizing them.
    Difference in resizing png from https://www.seekpng.com/ima/u2e6w7w7i1a9y3t4/ (1149x1333px) to 200px width

    png preview

    Difference in resizing jpg from https://www.vecteezy.com/vector-art/1957829-tech-background-with-abstract-wave-lines (4900x1960px) to 500px width

    jpg preview

  • If the selected file cannot be resized, the context menu item is disabled and shows additional information instead of item being hidden.

  • Console logging can be disabled.

Known issues

shrunked's People

Contributors

darktrojan avatar memeller avatar vilda007 avatar yfdyh000 avatar makoehr avatar veltsumatti avatar abajo avatar archaeopteryx avatar tmalch avatar chemi avatar m69g avatar nd83 avatar ofa- avatar

Stargazers

 avatar  avatar  avatar Jake Langford avatar Alkaphreak avatar  avatar Barnaby Walters avatar  avatar Num3 avatar  avatar  avatar

Watchers

 avatar  avatar Andreas avatar  avatar Betterbird avatar  avatar

shrunked's Issues

not working

still not working with TB 123.0b4
no skrink menu when sending email with big jpg photos

[Feature Request] Resize image to % of the original

I would like to have an option to resize image of any size (even small one) to 50% of the original.

This could be helpful scenario with custom display scaling. In my configuration images are crazy big after pasting to an email. Therefore I need to reduce size most of the time to 50%. Now I need to calculate and change size manually all the time.
And it is not the most practical.

So to have an option to resize any image to specific ratio/percents of the original size would be much appreciated.

Maybe there is another way how to achieve it. But I did not find it.

Thank you in advance.

Cancelled message in console....

when using the 'Shrunked Image Resizer' extension, if you opt to send images in a message, but decline the option to resize them, then a message similar to '09:59:04.457 uncaught exception: Resizing cancelled. 4' message is generated in the console.

INFO - HOW TO INSTALL

To install this plugin into your Thunderbird:

  1. Download repository (as a zip)
  2. unpack and enter plugin directory
  3. Select all files and compress them to zip
  4. Change extension to .XPI
  5. Import into Thunderbird

Done

Resize images inside message

Hello!

Big thanks for Your work on this addon! It is possible to make auto resize images inside message? Now user can right click image inside message and choose "Resize this image". Nobody do this and some messages are really big.

Great job, greetings!

inconsistent context-menu behavior

Possibly related to #22, but it works in one mode but not another.

  • Sometimes the context-menu shows "incompatible format" for a screenshot pasted;
  • Other times it shows "Resize this image ..." for the same thing (take a screenshot, Ctrl-V paste);
  • At all times, the auto-resize yes/no option works.
  • While writing this image, I pasted and deleted screenshots multiple times, and now even though the draft email is empty and I paste a single image, it is tracking multiple images that may be resized. Closing and restarting a new draft resets this logic.

I can take a screenshot, paste into the email, and it asks if I want to resize (or I can right-click and "Resize this image...").

image

From there, the popup correctly shows the current dimensions/file-size, and the file is large enough (both in dims and size) for a resize.

image

After I click on "Okay", the modal disappears and the image/email are unchanged. If I right-click and attempt to resize again, the image dimensions/size are unchanged.

My "Shrunked" settings:

image


Now, if I repaste that image, sometimes it says that it is not recognized:

image

though clicking on the "Resize disabled:" context menu still brings up the resizing modal.

If instead I accept the "Resize this image?" or "Resize these images?" Yes on the bottom, the image is resized as intended.


Console log:

image

Log at timestamp 11:07:23:557
11:07:23.557 WebExtensions: Unexpected return: 
Array [ File ]
​
0: File { lastModified: 1708790843556, size: 12965, type: "image/jpeg", … }
​​
blobImplType: "StreamBlobImpl[StreamBlobImpl[MultipartBlobImpl[MemoryBlobImpl]]]"
​​
lastModified: 1708790843556
​​
mozFullPath: ""
​​
name: ""
​​
size: 12965
​​
type: "image/jpeg"
​​
webkitRelativePath: ""
​​
<prototype>: FilePrototype { name: Getter, lastModified: Getter, webkitRelativePath: Getter, … }
​​​
constructor: function ()
​​​
lastModified: 
​​​
mozFullPath: 
​​​
name: 
​​​
webkitRelativePath: 
​​​
Symbol(Symbol.toStringTag): "File"
​​​
<get lastModified()>: function lastModified()
​​​
<get mozFullPath()>: function mozFullPath()
​​​
<get name()>: function name()
​​​
<get webkitRelativePath()>: function webkitRelativePath()
​​​
<prototype>: BlobPrototype { slice: slice(), stream: stream(), text: text(), … }
​
length: 1
​
<prototype>: Array []
shrunked.js:99

Log at timestamp 11:12:43.958
11:12:43.958 WebExtensions: Unexpected return: 
Array [ File ]
​
0: File { lastModified: 1708791163957, size: 11526, type: "image/jpeg", … }
​​
blobImplType: "StreamBlobImpl[StreamBlobImpl[MultipartBlobImpl[MemoryBlobImpl]]]"
​​
lastModified: 1708791163957
​​
mozFullPath: ""
​​
name: ""
​​
size: 11526
​​
type: "image/jpeg"
​​
webkitRelativePath: ""
​​
<prototype>: FilePrototype { name: Getter, lastModified: Getter, webkitRelativePath: Getter, … }
​​​
constructor: function ()
​​​
lastModified: 
​​​
mozFullPath: 
​​​
name: 
​​​
webkitRelativePath: 
​​​
Symbol(Symbol.toStringTag): "File"
​​​
<get lastModified()>: function lastModified()
​​​
<get mozFullPath()>: function mozFullPath()
​​​
<get name()>: function name()
​​​
<get webkitRelativePath()>: function webkitRelativePath()
​​​
<prototype>: BlobPrototype { slice: slice(), stream: stream(), text: text(), … }
​
length: 1
​
<prototype>: Array []
shrunked.js:99

Ubuntu-23.10 on Wayland.
Betterbird-115.8.0-bb24, Shrunked-5.7.1.
The only other extension enabled is Nostalgy++-4.1.4.

If you're not familiar with Betterbird: I understand you may not be looking to explicitly support non-TB. BB is forked from TB, maintained with hours/days of TB's releases, and pushes PRs back to TB (even though TB is woefully behind on many patches in general). In my experience BB has no extension-incompatibility issues with TB. I use other extensions (only one other currently, but others historically), and none of them work in TB and don't work in BB.

Shrinking menu not offered

On 115.7.0 and Shrunked 5.7 it does not offer menu for shrinking. However, when set to shrink automatically, it does do that.

Idea: Shrunk imeages in existing emails

First, thanks a lot for this fork!

Customers often send emails with very big images to me, that i dont need in this resolution. Is there a chance to implement a way to reduce those images in an existing email manually?

large picture fails to resize

I try to add an large picture (jpg) 6951px x 4633px with file size 17MB and the extension only show "Dateigröße neu schätzen..."
I assume te scaling algorithm has internally run into error condition.

Any option to fix that ? how can I send you the failing image as testcase ?

No prompt to resize images on Thunderbird Beta

Describe the bug
There is no prompt to resize the image when it is inserted or attached to the message.

To Reproduce
Insert or attach an image to a new message.

Expected behavior
A prompt should appear at the bottom of the screen offering to resize the image.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  1. Os = Windows 10
  2. Thunderbird version = 128.0b3
  3. Extension version = 5.8.1
  4. Image details - format, size, Any JPEG, PNG etc.
  5. Extension settings = default settings
  6. If you are having issues with manual resizing:
  • Is the notification displayed when image is attached - No
  • Is the notification displayed when image is inserted inline - No
  • Is there an option to resize the image when right clicking on attached / inline images - No
  1. Did this feature work in previous versions - Yes (not sure if on any 128.x.x versions though)

Additional context
Add any other context about the problem here. Please add e.g. debug log (Tools -> Developer Tools -> Error console)

Problem with autoresizing at 5.8.0

Hello!

At the beginning, big thanks to You for all the new features, especially resizing answered/forwarded inline images - that's a game changer! Really great job of You!

When testing new functions from release 5.8.0 I think that I see a little trouble with autoresizing when option window doesn't appear. When there is option "Automatically resize all images" choose and I create e-mail with image attachment, nothing happens when I try to send e-mail, message is not sent. I have to manually change properties of image, then message is sent.

shrunked

When I change above option to "Automatically resize inline images only" od disable auto resize then everything is fine.
Auto resize (without properties window) is really great function. I will be grateful if you look into the problem.

Greetings!

Image orientation (config issue and feature request)

Thanks for maintaining this extension, I really appreciate.

I have a weird behavior on Thunderbird 128.1.0 (Windows 11 x64), but I'm not sure if it happened before. The extension setting "auto orientation" (under EXIF) does not activate: it is not checked by default and every time I click it is immediately deactivated (check mark disappears).

Other than that, what could be very useful would be an option to manually specify rotation for images, even if EXIF data is not present. Rotation support is already there, maybe it's not that hard to implement this feature.

Version 5.6?

I think I may be going nuts..... I download the version tagged as 5.6 and I always get version 5.5... Is this correct or am I going nuts?
I'm new to Github so may be going wrong somewhere....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.