Fix filetype after last commit

This commit is contained in:
Hugo Posnic 2019-02-20 15:37:35 +01:00
parent d2c0a7905b
commit fb1c463a03

View file

@ -398,8 +398,10 @@ class Image:
self.reset() self.reset()
self.fullpath = fullpath self.fullpath = fullpath
if path.isfile(self.fullpath) and access(self.fullpath, WRITEABLE): if path.isfile(self.fullpath) and access(self.fullpath, WRITEABLE):
self.filetype = path.splitext(self.fullpath)[1] self.filetype = path.splitext(self.fullpath)[1][1:]
if self.filetype in [".jpeg", ".jpg", ".png"]: if self.filetype == "jpg":
self.filetype = "jpeg"
if self.filetype in ["jpeg", "png"]:
oldfile = QFileInfo(self.fullpath) oldfile = QFileInfo(self.fullpath)
self.shortname = oldfile.fileName() self.shortname = oldfile.fileName()
self.oldfilesize = oldfile.size() self.oldfilesize = oldfile.size()