# \[2.1.55\] Image size problem in Editor

**URL:** <https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507>\
**Category:** Help\
**Created:** [December 19, 2022, 12:36pm UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507 "2022-12-19T12:36:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://forums.ankiweb.net/u/vaibhav)\
**Post date:** [December 19, 2022, 12:36pm UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/1 "2022-12-19T12:36:31Z")

</div>

In the latest version (2.1.55), the images are shown too small in the editor (by default).  
Upon turning off the “Shrink images” option, the images become too large.

I want the size that was there in 2.1.54. Any suggestions?

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [December 21, 2022, 3:11am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/2 "2022-12-21T03:11:28Z")

</div>

My memory may be incorrect here, but I don’t think we intentionally changed the size images appear when shrunk. Can you post screenshots of .54 and .55 showing the difference?

---

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://forums.ankiweb.net/u/vaibhav)\
**Post date:** [December 23, 2022, 9:28am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/3 "2022-12-23T09:28:58Z")

</div>

I think you misunderstood my problem. My problem is with how images appear when enlarged. Now, the enlarged image is too large as compared to that in 2.1.54.

Also, now that I have installed 2.1.55, how do I install 2.1.54 for sending the screenshots?

---

<div class="post-metadata">

**Author:** ![kleinerpirat](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/kleinerpirat/32/19863_2.png) [@kleinerpirat](https://forums.ankiweb.net/u/kleinerpirat)\
**Post date:** [December 23, 2022, 10:04am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/4 "2022-12-23T10:04:37Z")

</div>

> [@vaibhav](#):
>
> how do I install 2.1.54 for sending the screenshots?

If you still have the installer in your Downloads folder, open that and Anki 2.1.54 will be installed over your current 2.1.55 install. This is safe and you won’t lose any data.

Otherwise download 2.1.54 from the official download site again. It is labelled as the “previous stable release”.

---

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://forums.ankiweb.net/u/vaibhav)\
**Post date:** [December 23, 2022, 4:42pm UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/5 "2022-12-23T16:42:04Z")

</div>

Here are the screenshots:

Anki 2.1.54

 ![Screenshot (18)](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/e/edc54ab40eadb9348f5a97bad5c4a7acf4ee6f6a.png)  
 ![Screenshot (17)](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/d/dfd913177be8d09a6f2dffba51b814551a52ea62.png)

Anki 2.1.55

 ![Screenshot (16)](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/d/d19e409ede7a81a7b97c03d1d8c124d13259bb8e.png)

Note that this is not the only card that is affected. Many cards are affected, with some using SVG images and some using JPGs.

To me, it seems that .54 limits the width of the image to the width of the editor (with some other rules to limit the height) but .55 does not do that.

The [add-on](https://ankiweb.net/shared/info/831846358) I am using to view editor side-by-side with the browser should not be responsible for the issue because it is disabled on .55 anyway.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [December 24, 2022, 2:59am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/6 "2022-12-24T02:59:22Z")

</div>

Thank you for the screenshots, that helped. When a new beta becomes available, please let me know if it doesn’t address the issue for you.

---

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://forums.ankiweb.net/u/vaibhav)\
**Post date:** [December 24, 2022, 3:24am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/7 "2022-12-24T03:24:58Z")

</div>

Thanks for the quick intervention.

As I am not very comfortable with installing betas, I will wait for the next stable release. I hope it happens soon.

---

<div class="post-metadata">

**Author:** ![jcznk](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/jcznk/32/15215_2.png) [@jcznk](https://forums.ankiweb.net/u/jcznk)\
**Post date:** [December 24, 2022, 12:18pm UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/8 "2022-12-24T12:18:42Z")

</div>

Maybe you could use this add-on in the meanwhile: [CSS Injector - Change default editor styles - AnkiWeb](https://ankiweb.net/shared/info/181103283)

Adding this code to field.css should limit the width of the images to that of the editor

```auto
img {
--editor-default-max-width: 100%;
}

```

---

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://forums.ankiweb.net/u/vaibhav)\
**Post date:** [December 24, 2022, 3:14pm UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/9 "2022-12-24T15:14:57Z")

</div>

Thanks for the suggestion. It worked.

---

<div class="post-metadata">

**Author:** ![jcznk](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/jcznk/32/15215_2.png) [@jcznk](https://forums.ankiweb.net/u/jcznk)\
**Post date:** [December 25, 2022, 3:29pm UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/10 "2022-12-25T15:29:05Z")

</div>

Be aware that this approach is not without any side effects. I noticed that when I copy images from the editor and paste them this code is added to their HTML:

`style="--editor-default-max-width: 100%;"`

This HTML should do nothing except pollute the code a little bit and marginally increase storage usage. You can remove it from all the notes using Find and Replace.

---

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://forums.ankiweb.net/u/vaibhav)\
**Post date:** [December 25, 2022, 4:36pm UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/11 "2022-12-25T16:36:58Z")

</div>

Thanks for this information too.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [December 28, 2022, 2:21am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/12 "2022-12-28T02:21:57Z")

</div>

That might cause the image resizing toggle in the editor to stop working. Maybe it could be avoided by applying it to the html element instead of img?

---

<div class="post-metadata">

**Author:** ![jcznk](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/jcznk/32/15215_2.png) [@jcznk](https://forums.ankiweb.net/u/jcznk)\
**Post date:** [December 28, 2022, 12:48pm UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/13 "2022-12-28T12:48:43Z")

</div>

> [@dae](#):
>
> That might cause the image resizing toggle in the editor to stop working

I don’t think there is such risk, unless you also override --editor-default-max-height?  
The width will not be capped to 250px anymore, but the images will still be shrunk. Or am I missing something else?  
I tried using html and :root and neither seemed to work.

OT: maybe it could be reasonable to add some class to the root element, to indicate whether the editor is shrunk or not? Kind of like the night-mode class.  
It would certainly be very helpful when injecting custom CSS and it would probably also have some other uses. In general, as far as I understand, it seems like a fairly simple change which would make the code more orderly and thus easier to interact with.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [December 30, 2022, 6:16am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/14 "2022-12-30T06:16:32Z")

</div>

I think we apply it to individual images because we allow users to contract/expand each image independently.

---

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://forums.ankiweb.net/u/vaibhav)\
**Post date:** [January 10, 2023, 5:04am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/15 "2023-01-10T05:04:32Z")

</div>

The issue has been fixed in the latest release (2.1.56).

My thanks to Damien for developing such a great app and for resolving issues so fast.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [January 11, 2023, 9:55am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/16 "2023-01-11T09:55:10Z")

</div>

It’s not just me that deserves thanks, but thank you for the kind words in any case 🙂

---

<div class="post-metadata">

**Author:** ![polyeyejoe](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@polyeyejoe](https://forums.ankiweb.net/u/polyeyejoe)\
**Post date:** [January 15, 2023, 2:27pm UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/17 "2023-01-15T14:27:29Z")

</div>

I also had the same image resizing problem as @vaibhav on 2.1.55 (Intel, Qt5) on macOS. This prompted me to downgrade back to 2.1.54 (Intel, Qt5) on macOS. I tried the 2.1.56 on macOS.

■ For 2.1.56 beta and stable release (Intel, Qt5): Automatically shrunken images failed to resize to window width when image shrinking disabled. In other words, they would remain the same size (shrunken) irrespective of whether image shrinking is enable or disabled.  
■ For 2.1.56 beta and stable release (Intel, Qt6): Automatically shrunken images failed to be constrained to window width when image shrinking disabled. In other words, they would be oversized.

Any ideas?

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [January 16, 2023, 2:16am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/18 "2023-01-16T02:16:11Z")

</div>

A fix for this is coming in the next update, thanks to @hkr.

---

<div class="post-metadata">

**Author:** ![polyeyejoe](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@polyeyejoe](https://forums.ankiweb.net/u/polyeyejoe)\
**Post date:** [January 18, 2023, 3:53am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/19 "2023-01-18T03:53:39Z")

</div>

Awesome sauce, thanks @dae and @hkr

---

<div class="post-metadata">

**Author:** ![polyeyejoe](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@polyeyejoe](https://forums.ankiweb.net/u/polyeyejoe)\
**Post date:** [January 20, 2023, 1:54am UTC](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507/20 "2023-01-20T01:54:35Z")

</div>

Tried 2.1.57 beta for macOS (Intel, Qt5) and I am no longer experiencing image resizing issues. Thank you!

However, my Note Type uses lots of fields and they take a noticeable while to load in the browser and editor, relative to 2.1.54 for macOS (Intel, Qt5). Wanted to relay this experience.

[Next page](https://forums.ankiweb.net/t/2-1-55-image-size-problem-in-editor/25507.md?page=2)
