Skip to content

Instantly share code, notes, and snippets.

@emre
Created July 10, 2010 15:40
Show Gist options
  • Save emre/470781 to your computer and use it in GitHub Desktop.
Save emre/470781 to your computer and use it in GitHub Desktop.
python thumbnailler icin isimlendirme isleri
class ThumbnailTools(object):
@staticmethod
def get_thumb_info(file):
reply = re.search("(.*?)\.([a-zA-Z]{3,4})$", file)
return (reply.group(1), reply.group(2))
@staticmethod
def get_thumb_name(file, thumb_type):
file_info = ThumbnailTools.get_thumb_info(file)
return "%s-%s.%s" % (file_info[0], thumb_type, file_info[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment