ImageResizer bug with latest Anki versions

Could be related to Qt6?

Debug info as follows:
Anki 23.10.1 (fac9e0ee) Python 3.9.15 Qt 6.5.3 PyQt 6.5.3
Platform: macOS-13.6.1-x86_64-i386-64bit
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-11-19 15:46:52
Add-ons possibly involved: ⁨ImageResizer⁩

Caught exception:
Traceback (most recent call last):
File “aqt.editor”, line 1476, in dropEvent
File “aqt.editor”, line 1495, in _processMime
File “_aqt.hooks”, line 2824, in call
File “/Users/h*****/Library/Application Support/Anki2/addons21/1214357311/init.py”, line 41, in will_process_mime_handler
return checkAndResize(mime)
File “/Users/h*****/Library/Application Support/Anki2/addons21/1214357311/init.py”, line 297, in checkAndResize
im = resize(im)
File “/Users/h*****/Library/Application Support/Anki2/addons21/1214357311/init.py”, line 142, in resize
transformationMode = Qt.FastTransformation if (Setup.config[‘scalingMode’] == ‘fast’) else Qt.SmoothTransformation
AttributeError: type object ‘Qt’ has no attribute ‘SmoothTransformation’

Yes, it’s related to Qt6. The add-on author needs to make some changes.

In Qt6, you have to use
Qt.TransformationMode.FastTransformation
Qt.TransformationMode.SmoothTransformation

A guide to these enums can be found at:

If you download the Qt5 version of 23.10.1, it might work for you.

1 Like

I think this add-on has now been updated to work on Qt6 for Anki 23.10 and higher.