Trekky12 / kburns-slideshow

generate slideshow movies with Ken Burns effect on images
MIT License
58 stars 15 forks source link

could not initiate slide show manager #12

Closed danya-gharbieh closed 2 years ago

danya-gharbieh commented 2 years ago

Screenshot (10)

i'm trying to integrate your plugin to my application so i created a button that opens your slideshow app and after i run the code it initiate slideshow app but when i'm trying to add new slide or open an exist .json file (previously saved) the attached error appears,

any idea ?

Trekky12 commented 2 years ago

Could you explain how you integrated the slideshow app in your application, e.g. by showing some code?

danya-gharbieh commented 2 years ago

yeah sure I added a button on my GUI then when we press on the button your slideshow app will open as shown in the code below:

slideshow_btn = tk.Button(self.frame, text="Slideshow editor", font=('arial', 16), width=20, height=10 , command=self.slideShowApp)

def slideShowApp(self): app3 = App() app3.grab_set()

this will open your slideshow app , btw I fixed the above error by update app.py file parameter from "class App(tk.TK)" to "class App(tk.Toplevel)" but I have another error so when slideshow app appears and then i press add slide below error appears:

Exception in Tkinter callback Traceback (most recent call last): File "C:\Program Files\Python310\lib\tkinter__init.py", line 1921, in call return self.func(*args) File "C:\Users\danya\OneDrive\Documents\application\kburns\gui\app.py", line 1267, in addSlide self.sm.addSlide(file, self.slide_selected) File "C:\Users\danya\OneDrive\Documents\application\kburns\slideshow\SlideManager.py", line 171, in addSlide slide = ImageSlide(self.ffmpeg_version, filename, output_width, output_height, slide_duration, File "C:\Users\danya\OneDrive\Documents\application\kburns\slideshow\ImageSlide.py", line 20, in init super().init(ffmpeg_version, file, output_width, output_height, File "C:\Users\danya\OneDrive\Documents\application\kburns\slideshow\Slide.py", line 28, in init__ self.transition = random.choice(self.getTransitions()) File "C:\Program Files\Python310\lib\random.py", line 378, in choice return seq[self._randbelow(len(seq))] IndexError: list index out of range

any idea about this error ?

Trekky12 commented 2 years ago

Actually I didn't test embedding the application in another application. Let me look into it. Could you provide a small running example code to show the problem? You don't need to provide your application but a small runnable example.

I think the error message has to do with the transition folder. Did you have the folder in the correct location?

danya-gharbieh commented 2 years ago

okay sure

kindly find a small runnable application in this link : https://drive.google.com/file/d/123EGl2Htv20XneM8qFh1WGJoyteNz5tl/view?usp=sharing

Thanks in advanced

Trekky12 commented 2 years ago

Hey @danya-gharbieh,

I've tested your code and you should move the folder "transitions" from the subfolder "kburns" to the root directory of the application. This solves the error messages. The reason for that is that the possible transitions are searched from this folder which is referenced from the root directory (os.getcwd()):

def getTransitions(self):
        return [package_name for importer, package_name, _ in pkgutil.iter_modules([os.path.join(os.getcwd(), "transitions")])]
danya-gharbieh commented 2 years ago

moving the folder works thanks a lot ,