← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 597: Applied a patch from emil-berg91 to fix the thumbnail image after resizing a clip to maintain the...

 

------------------------------------------------------------
revno: 597
fixes bug: https://launchpad.net/bugs/840853
author: emil-berg91
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot
timestamp: Sun 2011-12-11 15:38:46 -0600
message:
  Applied a patch from emil-berg91 to fix the thumbnail image after resizing a clip to maintain the curved edges.
modified:
  openshot/classes/clip.py
  openshot/classes/files.py
  openshot/classes/thumbnail.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/classes/clip.py'
--- openshot/classes/clip.py	2011-10-18 20:24:35 +0000
+++ openshot/classes/clip.py	2011-12-11 21:38:46 +0000
@@ -129,11 +129,10 @@
 				new_name = "thumbnail/" + file_base_name.replace("%d","%%d") + "_" + ext + "_" + str(i) + ".png"
 	
 			# Create the new thumbnail
-			thumbnailer.get_thumb_at_frame(self.file_object.name, start_frame, new_name)
+			thumbnailer.get_thumb_at_frame(self.file_object.name, start_frame, new_name, False)
 			
 			# Update the path to the thumbnail
 			self.thumb_location = path
-			print "thumb " + self.thumb_location
 			
 		elif not file_type == "audio":
 			# Use the file thumbnail instead, to avoid creating a new

=== modified file 'openshot/classes/files.py'
--- openshot/classes/files.py	2011-09-29 16:04:35 +0000
+++ openshot/classes/files.py	2011-12-11 21:38:46 +0000
@@ -123,7 +123,7 @@
 			new_name = "thumbnail/" + file_base_name + "_" + ext + "_1.png"
 			
 			# Create the new thumbnail
-			thumbnailer.get_thumb_at_frame(self.name, new_name=new_name)
+			thumbnailer.get_thumb_at_frame(self.name, new_name=new_name, full_size=False)
 
 ########################################################################
 class OpenShotFolder:

=== modified file 'openshot/classes/thumbnail.py'
--- openshot/classes/thumbnail.py	2011-08-27 21:53:40 +0000
+++ openshot/classes/thumbnail.py	2011-12-11 21:38:46 +0000
@@ -238,9 +238,10 @@
 		self.profile = None
 		self.f = None
 		
-	def get_thumb_at_frame(self, filename, frame=1, new_name=""):
-		'''by passing a value in new_name, this will extract a 
-		 full size frame (based on the project profile).'''
+	def get_thumb_at_frame(self, filename, frame=1, new_name="", full_size=True):
+		""" if new_name = None, it will default to  'name_fileext + "_%d.ext' in the thumbnail folder.
+		if full_size is True, a full size frame will be extracted (based on the project profile).
+		Else: quarter_ntsc"""
 		
 		self.file_name = filename
 		
@@ -254,10 +255,10 @@
 		mlt.Factory.init()
 		
 		# set the profile
-		if new_name == "":
+		if full_size:
+			self.profile = profiles.mlt_profiles(self.project).get_profile(self.project.project_type)
+		else:
 			self.profile = mlt.Profile("quarter_ntsc")
-		else:
-			self.profile = profiles.mlt_profiles(self.project).get_profile(self.project.project_type)
 		
 		# Create the producer
 		self.p = mlt.Producer( self.profile, '%s' % self.file_name )