GithubHelp home page GithubHelp logo

anki21__openinexternaleditor_rename_duplicate_for_image_audio_video's People

Contributors

ijgnd avatar nsbum avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

nsbum

anki21__openinexternaleditor_rename_duplicate_for_image_audio_video's Issues

Annoying error found while creating a new fresh image

Hi, so when selected "New Image" option in a desired field Anki prompts this nasty error message:

Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 5.15.2 PyQt 5.15.5
Platform: Windows 10
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2022-09-16 18:05:31

Caught exception:
Traceback (most recent call last):
  File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\1560623518\edit_insert_rename_duplicate.py", line 132, in <lambda>
    a.triggered.connect(lambda _, o=i[1], ed=e: new_and_edit(e, o))
  File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\1560623518\editExternal.py", line 216, in new_and_edit
    new_and_edit_image(editor)
  File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\1560623518\editExternal.py", line 159, in new_and_edit_image
    shutil.copy(template_full_path, new_full_path)
  File "shutil", line 426, in copy
  File "shutil", line 265, in copyfile
PermissionError: [Errno 13] Permission denied: '2022-09-17__15-20-09_1.png'

imagen

Do you know about this or is it new?

tooltip after rename ("Changed nids ...") is confusing

Hello.
When renaming an image with this addon, the message reads
"Changed nids: [xxxxxxxxxxxx], Renamed file: [Blah.png]"
Changed nids only means the notes mentioned have had references to the renamed image updated right?

Image format lost for a second [image editing]

Hi again,

it's just a small detail, but this happens after editing a pic in external software:

imagen
imagen
imagen

It automatically changes from 2nd to 3rd pic by just clicking in another field card. Sometimes it shows letters and chars, but it's either one of these two options. May it be related to #11 ?

bug in "last update" = uploads from end of november

reported in a review on ankiweb:

Unfortunately since the last updated I don't know why it doesn't work anymore. I use your addon to edit audios in an external program called WavePad, to do that I change the path in "settings" exactly like described below, but since the last update when try to edit the audio files it doesn't open any program. I also tried to edit the file "config.json" in notepad but it doesn't work as well. I hope you can help me with this matter, thanks in advance!

{
    "File Manager in Linux and its args": [
        "nautilus",
        "--select"
    ],
    "image__show_context_menu_entry_for__showInExplorerFinderFileManager": true,
    "image__show_context_menu_entry_for__showPathAndPutToClipboard": true,
    "image_duplicate__show_in_editor_context_menu": true,
    "image_edit_externally__block_Anki_during_edit": true,
    "image_edit_externally__program": "mspaint",
    "image_edit_externally__show_in_editor_context_menu": true,
    "image_edit_externally__show_in_reviewer_context_menu": true,
    "image_empty_insert_and_edit__file_from_user_files": "empty.png",
    "image_empty_insert_and_edit__show_in_editor_context_menu": true,
    "image_rename__show_in_editor_context_menu": true,
    "sound__extensions_audio": [
        "wav",
        "mp3",
        "m4a",
        "opus",
        "ogg",
        "oga"
    ],
    "sound__external_program_audio": "C:\\Program Files (x86)\\NCH Software\\WavePad\\wavepad.exe",
    "sound__external_program_video": "vlc",
    "sound__show_context_menu_entry_for__duplicate": true,
    "sound__show_context_menu_entry_for__editExternally": true,
    "sound__show_context_menu_entry_for__rename": true,
    "sound__show_context_menu_entry_for__showInExplorerFinderFileManager": true,
    "sound__show_context_menu_entry_for__showPathAndPutToClipboard": true,
    "sound__show_tooltip_two_soundfiles_selected": true
}

Using command line parameters in Open with

Hello.
I'd like to open my images with ShareX's image editor.
The syntax to open it is "C:\Program Files\ShareX\ShareX.exe" -ImageEditor "%1".
How can I use parameters in your addon?

show in filemanager broken in MacOS 12 and Anki 2.1.55

it didn't work when i tested.

using abdo's independently developed add-on Reveal in File Manager has the same problem. When I run the command to show the image in the finder the finder just gets focused but the folder shown in the finder is not adjusted/changed/updated.

This is not a big problem for my add-on because I also have the command "copy path to clipboard".

reaname broken?

reported on 2.1.55 on MacOS

reported in the anki forums, https://forums.ankiweb.net/t/is-there-an-addon-to-reveal-files-in-a-file-manger-fom-editor-window/25202/12 :

Anki 2.1.55 (f38c4e2f) Python 3.9.15 Qt 5.14.2 PyQt 5.14.1
Platform: macOS-12.6.1-x86_64-i386-64bit
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2022-12-09 23:01:09
Möglicherweise beteiligte Erweiterungen: <U+2068>OpenInExternalEditorRenameDuplicate for ImageAudioVideo<U+2069>

Caught exception:
Traceback (most recent call last):
  File "aqt.webview", line 562, in handler
  File "aqt.editor", line 576, in <lambda>
  File "/Users/ferophila/Library/Application Support/Anki2/addons21/1560623518/edit_insert_rename_duplicate.py", line 79, in <lambda>
    editor.saveNow(lambda: func(editor, fname, type, field))
  File "/Users/ferophila/Library/Application Support/Anki2/addons21/1560623518/rename.py", line 133, in rename
    cnt = _replace_all_img_src(ep, fname, new_filename)
  File "/Users/ferophila/Library/Application Support/Anki2/addons21/1560623518/rename.py", line 64, in _replace_all_img_src
    op_chg_cnt = mw.col.backend.find_and_replace(
  File "anki._backend_generated", line 1554, in find_and_replace
  File "anki._backend", line 148, in _run_command
anki.errors.InvalidInput: <pre>regex parse error:
    (?i)(?P<first><img[^>]* src=)(?:"Bildschirmfoto\ 2022\-12\-08\ at\ 22\.54\.07@2x\.png")|(?:'Bildschirmfoto\ 2022\-12\-08\ at\ 22\.54\.07@2x\.png')(?P<second>[^>]*>)
                                                   ^^
error: unrecognized escape sequence</pre>

FileNotFoundError exception when renaming media

This started occurring after upgrading to 2.1.51.

Anki 2.1.51 (cf78a555) Python 3.10.4 Qt 6.3.0 PyQt 6.3.0
Platform: Linux
Flags: frz=False ao=True sv=2
Add-ons, last update check: 2022-05-09 12:19:09
Add-ons possibly involved: ⁨OpenInExternalEditorRenameDuplicate for ImageAudioVideo⁩

Caught exception:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/aqt/webview.py", line 562, in handler
    cb(val)
  File "/usr/lib/python3.10/site-packages/aqt/editor.py", line 558, in <lambda>
    self.web.evalWithCallback("saveNow(%d)" % keepFocus, lambda res: callback())
  File "/home/user/.local/share/Anki2/addons21/1560623518/edit_insert_rename_duplicate.py", line 79, in <lambda>
    editor.saveNow(lambda: func(editor, fname, type, field))
  File "/home/user/.local/share/Anki2/addons21/1560623518/rename.py", line 136, in rename
    os.rename(fname, newfilename)
FileNotFoundError: [Errno 2] No such file or directory: 'paste-e68a59da42757e68a20d35ac35a0f1f0145c6400.jpg' -> 'image-rename-issue.jpg'

Steps to reproduce the issue

  1. Open Add dialog
  2. Paste an image into one of the fields
  3. Right-click the image and select 'Image - Rename'
  4. Type in a new name and press 'OK'

add documentation how editing in external app works on macos

with the default security settings I think I can't save the modified image back to the anki folder.

giving Anki "Full Disc Access" from the system settings privacy tab, but do I really need this?

@NSBum : this summer you were so kind to improve how my add-on "openInExternalEditor,Rename..." works with commits like 95545d7 . Does saving just work for you or did you adjust some settings in MacOS itself to get it working? I'd be grateful if you have some time in the coming weeks to give me some sentences that I could post in the add-on description on ankiweb.

Infinite loop in image editing (sometimes)

Hi,

After editing something in an external program/creating a new image, sometimes, it enters an infinite loop of [processing]. I use Paint.NET for that. After doing the edit issue, i press save and then the program closes, but Anki enters an infinite loop of "processing" the changes, i fear.

Also, the image ratio appears heavily altered, as you can see here:

imagen

Waited a few minutes, but it didn't do anything, so i just had to restart Anki. After that, the image editing changes appear without problem, so the edition process seems to work correctly.

Strangely, this doesn't happen every time while editing a pic. I've done some edition tests and there were all good (no infinite loop of waiting process), so i'm not sure when it may happen again.

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.