Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon not working in Krita 5.2.+ #5

Open
MeshVoid opened this issue Nov 24, 2023 · 2 comments
Open

Addon not working in Krita 5.2.+ #5

MeshVoid opened this issue Nov 24, 2023 · 2 comments

Comments

@MeshVoid
Copy link

Hi! I'm having problems running photobash plugin in 5.2.0 and 5.2.1 versions of Krita. It loads fine, but it shows an errot whenever I choose an image from the docker view.
Here's an error log I get after clicking on an image thumbnail in photobask docker to import it:

TypeError
Python 3.10.7: C:\Apps\Krita\bin\krita.exe
Fri Nov 24 15:31:06 2023

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

C:\Apps\Krita\share\krita\pykrita\photobash_images\photobash_images_docker.py in buttonClick(self=<photobash_images.photobash_images_docker.PhotobashDocker object>, position=0)
448 def buttonClick(self, position):
449 if position < len(self.foundImages) - len(self.imagesButtons) * self.currPage:
450 self.addImageLayer(self.foundImages[position + len(self.imagesButtons) * self.currPage])
451
452 def changePath(self):
self = <photobash_images.photobash_images_docker.PhotobashDocker object>
self.addImageLayer = <bound method PhotobashDocker.addImageLayer of <....photobash_images_docker.PhotobashDocker object>>
self.foundImages = ['C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/apartments1.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...-apartments-shopfronts-shutters/apartments2-2.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/apartments2.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...artments-shopfronts-shutters/apartments2_side.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/apartments4.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/apartments5.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/apartments6.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/apartments7.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/apartments8.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/apartments9.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...artments-shopfronts-shutters/apartment_block5.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...artments-shopfronts-shutters/apartment_block6.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...artments-shopfronts-shutters/apartment_block7.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...artments-shopfronts-shutters/apartment_block8.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/building_5c.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...partments-shopfronts-shutters/building_center.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...nts-shopfronts-shutters/building_church_side1.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...pfronts-shutters/building_church_side_bottom1.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...pfronts-shutters/building_church_side_bottom2.png', 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...-shopfronts-shutters/building_church_side_top.png', ...]
position = 0
builtinlen =
self.imagesButtons = [<photobash_images.photobash_images_modulo.Photobash_Button object>, <photobash_images.photobash_images_modulo.Photobash_Button object>, <photobash_images.photobash_images_modulo.Photobash_Button object>, <photobash_images.photobash_images_modulo.Photobash_Button object>, <photobash_images.photobash_images_modulo.Photobash_Button object>, <photobash_images.photobash_images_modulo.Photobash_Button object>, <photobash_images.photobash_images_modulo.Photobash_Button object>, <photobash_images.photobash_images_modulo.Photobash_Button object>, <photobash_images.photobash_images_modulo.Photobash_Button object>]
self.currPage = 0

C:\Apps\Krita\share\krita\pykrita\photobash_images\photobash_images_docker.py in addImageLayer(self=<photobash_images.photobash_images_docker.PhotobashDocker object>, photoPath='C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/apartments1.png')
345 # Scale Image
346 if self.fitCanvasChecked:
347 image = QImage(photoPath).scaled(doc.width() * scale, doc.height() * scale, Qt.KeepAspectRatio, Qt.SmoothTransformation)
348 else:
349 image = QImage(photoPath)
image undefined
global QImage = <class 'PyQt5.QtGui.QImage'>
photoPath = 'C:/Sketchbook/000_FOR_PHOTOBASH/000_BUILDINGS/bu...gs-apartments-shopfronts-shutters/apartments1.png'
).scaled undefined
doc = <PyKrita.krita.Document object>
doc.width =
scale = 1.0
doc.height =
global Qt = <class 'PyQt5.QtCore.Qt'>
Qt.KeepAspectRatio = 1
Qt.SmoothTransformation = 1
TypeError: arguments did not match any overloaded call:
scaled(self, int, int, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
scaled(self, QSize, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
cause = None
class = <class 'TypeError'>
context = None
delattr = <method-wrapper 'delattr' of TypeError object>
dict = {}
dir =
doc = 'Inappropriate argument type.'
eq = <method-wrapper 'eq' of TypeError object>
format =
ge = <method-wrapper 'ge' of TypeError object>
getattribute = <method-wrapper 'getattribute' of TypeError object>
gt = <method-wrapper 'gt' of TypeError object>
hash = <method-wrapper 'hash' of TypeError object>
init = <method-wrapper 'init' of TypeError object>
init_subclass =
le = <method-wrapper 'le' of TypeError object>
lt = <method-wrapper 'lt' of TypeError object>
ne = <method-wrapper 'ne' of TypeError object>
new =
reduce =
reduce_ex =
repr = <method-wrapper 'repr' of TypeError object>
setattr = <method-wrapper 'setattr' of TypeError object>
setstate =
sizeof =
str = <method-wrapper 'str' of TypeError object>
subclasshook =
suppress_context = False
traceback =
args = ("arguments did not match any overloaded call:\n s...ormation): argument 1 has unexpected type 'float'",)
with_traceback =

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
File "C:\Apps\Krita\share\krita\pykrita\photobash_images\photobash_images_docker.py", line 450, in buttonClick
self.addImageLayer(self.foundImages[position + len(self.imagesButtons) * self.currPage])
File "C:\Apps\Krita\share\krita\pykrita\photobash_images\photobash_images_docker.py", line 347, in addImageLayer
image = QImage(photoPath).scaled(doc.width() * scale, doc.height() * scale, Qt.KeepAspectRatio, Qt.SmoothTransformation)
TypeError: arguments did not match any overloaded call:
scaled(self, int, int, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
scaled(self, QSize, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'

@MeshVoid MeshVoid changed the title Addon not working in the newwest versions of Krita. Addon not working in Krita 5.2.+ Nov 24, 2023
@duskydd
Copy link
Contributor

duskydd commented Dec 3, 2023

I implemented a simple fix with #6 working on Krita 5.2.1

@veryprofessionaldodo
Copy link
Owner

Apologies, I haven't seen this code so long I kind of abandoned this. @duskydd thank you so much for the fix, working on it now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants