← Back to team overview

openshot.bugs team mailing list archive

[Bug 1154416] [NEW] ZeroDivisionError: float division by zero

 

Public bug reported:

1) Ubuntu 12.10
2) apt-get install openshot
3) Openshot 1.4.3
4) melt 0.8.0

I was adding a still image to a track and messing with the fades. I'm
not sure what happened, but OpenShot crashed. It must have saved the
project right before the crash, because all subsequent tries to open the
file resulted in OpenShot crashing. Running OpenShot from the command
line showed a ZeroDivisionError:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openshot/windows/MainGTK.py", line 881, in recent_item_activated
    self.open_project(file_to_open)
  File "/usr/lib/pymodules/python2.7/openshot/windows/MainGTK.py", line 886, in open_project
    self.project.Open(file_to_open)
  File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line 347, in Open
    open_project.open_project(self, file_path)
  File "/usr/lib/pymodules/python2.7/openshot/classes/open_project.py", line 123, in open_project
    project_object.RefreshXML()
  File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line 287, in RefreshXML
    self.GenerateXML(os.path.join(self.USER_DIR, "sequence.mlt"))
  File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line 258, in GenerateXML
    self.sequences[0].GenerateXML(dom, tractor1)
  File "/usr/lib/pymodules/python2.7/openshot/classes/sequences.py", line 232, in GenerateXML
    MyTrack.GenerateXML(dom, multitrack, fps=fps)
  File "/usr/lib/pymodules/python2.7/openshot/classes/track.py", line 111, in GenerateXML
    current_frame = MyClip.GenerateXML(dom, playlist, current_frame, fps=fps)
  File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 654, in GenerateXML
    self.GenerateComposites(dom, current_frame, ending_frame, preview_mode, fps=fps)
  File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 754, in GenerateComposites
    self.CreateCompositeXML(dom, current_frame, end, "fade in", fps=fps)
  File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 829, in CreateCompositeXML
    h1, h2 = self.get_keyframe_values("height", current_frame, end_frame, fps, clip_length_frames, kf_start, kf_end)
  File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 1026, in get_keyframe_values
    units = prop_diff / clip_length_frames
ZeroDivisionError: float division by zero

Editing /usr/lib/pymodules/python2.7/openshot/classes/clip.py with this
fixed my problem:

-		if prop_diff != 0:
+		if prop_diff != 0 and clip_length_frames > 0.0:

** Affects: openshot
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenShot
Bugs, which is subscribed to OpenShot Video Editor.
https://bugs.launchpad.net/bugs/1154416

Title:
  ZeroDivisionError: float division by zero

Status in OpenShot Video Editor:
  New

Bug description:
  1) Ubuntu 12.10
  2) apt-get install openshot
  3) Openshot 1.4.3
  4) melt 0.8.0

  I was adding a still image to a track and messing with the fades. I'm
  not sure what happened, but OpenShot crashed. It must have saved the
  project right before the crash, because all subsequent tries to open
  the file resulted in OpenShot crashing. Running OpenShot from the
  command line showed a ZeroDivisionError:

  Traceback (most recent call last):
    File "/usr/lib/pymodules/python2.7/openshot/windows/MainGTK.py", line 881, in recent_item_activated
      self.open_project(file_to_open)
    File "/usr/lib/pymodules/python2.7/openshot/windows/MainGTK.py", line 886, in open_project
      self.project.Open(file_to_open)
    File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line 347, in Open
      open_project.open_project(self, file_path)
    File "/usr/lib/pymodules/python2.7/openshot/classes/open_project.py", line 123, in open_project
      project_object.RefreshXML()
    File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line 287, in RefreshXML
      self.GenerateXML(os.path.join(self.USER_DIR, "sequence.mlt"))
    File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line 258, in GenerateXML
      self.sequences[0].GenerateXML(dom, tractor1)
    File "/usr/lib/pymodules/python2.7/openshot/classes/sequences.py", line 232, in GenerateXML
      MyTrack.GenerateXML(dom, multitrack, fps=fps)
    File "/usr/lib/pymodules/python2.7/openshot/classes/track.py", line 111, in GenerateXML
      current_frame = MyClip.GenerateXML(dom, playlist, current_frame, fps=fps)
    File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 654, in GenerateXML
      self.GenerateComposites(dom, current_frame, ending_frame, preview_mode, fps=fps)
    File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 754, in GenerateComposites
      self.CreateCompositeXML(dom, current_frame, end, "fade in", fps=fps)
    File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 829, in CreateCompositeXML
      h1, h2 = self.get_keyframe_values("height", current_frame, end_frame, fps, clip_length_frames, kf_start, kf_end)
    File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 1026, in get_keyframe_values
      units = prop_diff / clip_length_frames
  ZeroDivisionError: float division by zero

  Editing /usr/lib/pymodules/python2.7/openshot/classes/clip.py with
  this fixed my problem:

  -		if prop_diff != 0:
  +		if prop_diff != 0 and clip_length_frames > 0.0:

To manage notifications about this bug go to:
https://bugs.launchpad.net/openshot/+bug/1154416/+subscriptions


Follow ups

References