Coder Social home page Coder Social logo

image-style-editor's People

Contributors

arthur-milchior avatar bluegreenmagick avatar hwiet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

arthur-milchior

image-style-editor's Issues

Image Occlusion & AnkiDroid bug

The add-on works perfectly on the desktop with the image occlusion enhanced note type, but when these cards are viewed on AnkiDroid, they appear as blank (no error code, nothing). The hidden div setting on your add-on is still set to true, no settings have been changed in yours or the IOE add-on.

I added screenshots from an example note's edit window in AnkiDroid. If I edit out the style changes manually, the original image with masks appears again. But I can't figure out how to fix it so I can still use your add-on as designed on the desktop.

Screenshot_20200407-165131
Screenshot_20200407-165149

~ Thanks

Error encountered when pasting image into existing card

Anki called out this addon. However, the error persisted after I disabled the addon. I had to also disable ImageResizer to eliminate the error.

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.38 (355e4cd5) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-01-21 08:59:59

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 35, in cmd
File "aqt\webview.py", line 124, in _onCmd
File "aqt\webview.py", line 569, in onBridgeCmd
File "", line 2, in onBridgeCmd
File "anki\hooks.py", line 89, in decorator_wrapper
File "anki\hooks.py", line 86, in repl
File "C:\Users\david\AppData\Roaming\Anki2\addons21\1593969147_init
.py", line 573, in onBridgeCmd
return _old(self, cmd)
File "aqt\editor.py", line 442, in onBridgeCmd
File "aqt\editor.py", line 944, in onPaste
File "aqt\editor.py", line 1062, in onPaste
File "aqt\editor.py", line 1056, in _onPaste
File "", line 2, in _processMime
File "anki\hooks.py", line 89, in decorator_wrapper
File "anki\hooks.py", line 86, in repl
TypeError: _processMime_around() got multiple values for argument '_old'

Loses the ratio after finishing editing

I changed the empty_means to auto, and the image seems to resize successfully on the Editing page. However when I finished and closed the Editing page, the image shown is out of ratio (often becomes flattened). Please help, thanks.

Latex/Mathjax content lost, backslashes get eaten

Hi,

tldr; field being evaluated causes the contents to be altered. Changes from \t into a tab, and \f into an arrow, etc.

I love your addon! But I just noticed an issue on Anki version:
Version 2.1.22 (0ecc189a)
Python 3.8.0 Qt 5.14.1 PyQt 5.14.1

If I have a mathjax equation then resizing the image will cause any of the back slashed sequences to be removed.

Simple test:
Before setting the image format:
15-17-3-002324

After setting the image format:
15-17-3-002325

Note the removal of the backslashes from the field which destroys the mathjax capability. \frac turns into rac, \( turns into (, and \) turns into ).

I haven't looked deep into the python but anything that reads in the field contents and then prints it back will probably eat the backslash thinking the user was trying to escape a character or create a tab (\t) or something.

Edit:
So I noticed another thing, the backslashes are not really being "eaten" so to speak. They're just being evaluated to be a new escaped char, for example here's the \t

image

And we can see where the \f went here in the preview:
15-17-26-002326

All images with the same default size

Hey, thanks for making this, it is definitely the solution I was looking for. Since most of the times the images I use are way too big on my reviewer view.


I'm stuck trying to add a default for all images.

So far I've been able to individually right click on an image (when editing a card with an image)

and I see the original dimensions, then I need to click on "Default" in order to load my default size which right now is set to 600px

image

image

Here are my settings in the config

{
    "empty_means": "auto",
    "hidden-div-for-image-only-field": false,
    "max-size": false,
    "min-size": false,
    "zdefaults": {
        "Apply to all fields": true,
        "Apply to all notes": true,
        "height": "",
        "max-height": "",
        "max-width": "",
        "min-height": "",
        "min-width": "",
        "width": "600px"
    },
    "zzimage-occlusion-field-position": [
        3,
        4,
        10,
        11
    ],
    "zzimage-occlusion-hidden-div": true,
    "zzimage-occlusion-id-field": "ID (hidden)",
    "zzimage-occlusion-note-type": "Image Occlusion Enhanced",
    "zzz-version-checkpoint": "2.4"
}

the only lines I've change are

    "empty_means": "auto",

and

        "width": "600px"

What I'd like to achieve is for every image to already be set to 600px.
Without me having to right click > click default. SInce that would be a lot of manual work everytime I add or modify an image.


Ideally I'd want for every photo across all of my decks to be converted to have 600px.

Is this possible? Perphas it already is but I'm stuck figuring it out.

Thank you

doesn't work when a line break is in the html source

First of all: Thanks for sharing this add-on and sorry for the following hasty issue. I don't use your add-on so I might have missed something?

I recently got a one sentence report that my "add table add-on" breaks "image style editor".

I did a quick check and indeed when I add a simple table to a field there's no value for "original width" and "original height" in the "Style Editor" dialog that I open from the context menu after right clicking an image in my editor.

It's apparently not about tables but about line breaks in the html source. This doesn't work:

<img src="qev3z18vtwp31.png">
<div>test</div>

This works:

<img src="qev3z18vtwp31.png"><div>test</div>

Debug Info:

Anki 2.1.20 (47a1bf8b) Python 3.8.1 Qt 5.14.1 PyQt 5.14.1
Platform: Linux
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-03-03 09:37:52


===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Add Table ['1237621971', 2019-11-06T22:23, 'None', mod]
Image Style Editor ['1593969147', 2020-01-29T14:06, 'None', mod]

===IDs of active AnkiWeb add-ons===
1237621971 1593969147

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

Anki error message

Hi,

This is my favorite addon, but it suddenly stopped working and I'm getting an error message when I start up Anki. I didn't update Anki or anything. I currently have Anki version 2.1.26. Can you please help?

Thanks.

cannot couple Image Occlusion Enhanced

Hello

Thanks for your add-on. Great it can change all the blocks on Image Occlusion Enhanced.

It can work properly on normal pictures that when I modify the width or height of the pictures, they can flex correspondently.

But if I paste the picture onto Image Occlusion Enhanced and add some blocks, then resize this picture with Image Style Editor, the picture cannot morph correspondently (aspect ratio) even though I have set 'auto' in the config.
To be more detailed, if I change the width of the picture, the width, along with the blocks, will change but the height will not do automatically (aspect ratio) and vice versa.

How to fix this?
Anki 2.1.20
Image Style Editor 2.4
Image Occlusion Enhanced for Anki 2.1 (alpha) 1.3.0-alpha5

Besides, hopefully you can add options to change the real size (storage) of the pictures while modifying them to have a better manageable anki :D
As you know, the more media you add to anki, the more space it will take up, especially noticeable on mobile.

Shortcut

Hello,

i really like that there is no quality loss with this addon and wanted to ask if you plan to add a shortcut similar to the ImageResizer addon?

Hello, apply to all notes is not working

As the title says, apply to all fields works fine but nothing happens after selecting apply to all notes.

I saw these reviews on the add on page

Great addon.

However I'm still having trouble with IO cards. "apply to all fields" is working, but if I select "apply to all notes" the addon doesn't do anything.
I never messed around with the fields of the IO cards. I still checked them to make sure, they are all default.

and

Great!

If any of you is having trouble using the "apply to all fields/notes" for IO enhanced: check if you have moved any fields or created new ones so that you messed up the original field order, fix it and try again; or you can also edit the addon's configuration

I am not sure how to check for any moved fields like the second review suggests

Error message when used while creating cards

Hello

I am using version 3.1.33 and when I try to resize an image while in the "add cards window" I get an error message.


Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.33 (3f403040) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-09-06 19:29:28

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 37, in cmd
File "aqt\webview.py", line 123, in onCmd
File "aqt\webview.py", line 547, in onBridgeCmd
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-84>", line 2, in onBridgeCmd
File "anki\hooks.py", line 638, in decorator_wrapper
File "anki\hooks.py", line 635, in repl
File "C:\Users\Paul\AppData\Roaming\Anki2\addons21\1593969147_init
.py", line 551, in onBridgeCmd
main.modify_fields(cmd)
File "C:\Users\Paul\AppData\Roaming\Anki2\addons21\1593969147_init
.py", line 501, in modify_fields
editor.note.flush()
File "anki\notes.py", line 67, in flush
AssertionError

ASK

ImageResizer ADDon and image style editor
there are made
to show images with wanted scale in the preview window ???
or
to show images with wanted scale in the Edit window only ???

Not working on 2.1.30

Hello. This add-on is not working for me at all. My Anki version is 2.1.30. When I click OK on the Style Editor dialog box, I get the following error message. This happens even if I disable all other add-ons.

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeat until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site.
Debug info:
Anki 2.1.30 (06a69c25) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-08-18 23:26:52

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 37, in cmd
File "aqt\webview.py", line 123, in onCmd
File "aqt\webview.py", line 547, in onBridgeCmd
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-12>", line 2, in onBridgeCmd
File "anki\hooks.py", line 638, in decorator_wrapper
File "anki\hooks.py", line 635, in repl
File "C:\Users\harry\AppData\Roaming\Anki2\addons21\1593969147_init
.py", line 551, in onBridgeCmd
main.modify_fields(cmd)
File "C:\Users\harry\AppData\Roaming\Anki2\addons21\1593969147_init
.py", line 501, in modify_fields
editor.note.flush()
File "anki\notes.py", line 67, in flush
AssertionError

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.