mirror of
https://github.com/k4yt3x/video2x.git
synced 2025-01-04 04:39:10 +00:00
ignoring all python-magic errors
This commit is contained in:
parent
eb2b62b056
commit
751150fe64
@ -4,7 +4,7 @@
|
|||||||
Name: Video2X Upscaler
|
Name: Video2X Upscaler
|
||||||
Author: K4YT3X
|
Author: K4YT3X
|
||||||
Date Created: December 10, 2018
|
Date Created: December 10, 2018
|
||||||
Last Modified: June 4, 2020
|
Last Modified: June 5, 2020
|
||||||
|
|
||||||
Description: This file contains the Upscaler class. Each
|
Description: This file contains the Upscaler class. Each
|
||||||
instance of the Upscaler class is an upscaler on an image or
|
instance of the Upscaler class is an upscaler on an image or
|
||||||
@ -473,7 +473,7 @@ class Upscaler:
|
|||||||
input_file_mime_type = magic.from_file(str(self.current_input_file.absolute()), mime=True)
|
input_file_mime_type = magic.from_file(str(self.current_input_file.absolute()), mime=True)
|
||||||
input_file_type = input_file_mime_type.split('/')[0]
|
input_file_type = input_file_mime_type.split('/')[0]
|
||||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||||
except magic.magic.MagicException:
|
except Exception:
|
||||||
input_file_type = input_file_subtype = None
|
input_file_type = input_file_subtype = None
|
||||||
|
|
||||||
# in case python-magic fails to detect file type
|
# in case python-magic fails to detect file type
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
Creator: Video2X GUI
|
Creator: Video2X GUI
|
||||||
Author: K4YT3X
|
Author: K4YT3X
|
||||||
Date Created: May 5, 2020
|
Date Created: May 5, 2020
|
||||||
Last Modified: June 4, 2020
|
Last Modified: June 5, 2020
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
@ -137,7 +137,7 @@ class InputTableModel(QAbstractTableModel):
|
|||||||
input_file_mime_type = magic.from_file(str(file_path.absolute()), mime=True)
|
input_file_mime_type = magic.from_file(str(file_path.absolute()), mime=True)
|
||||||
input_file_type = input_file_mime_type.split('/')[0]
|
input_file_type = input_file_mime_type.split('/')[0]
|
||||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||||
except magic.magic.MagicException:
|
except Exception:
|
||||||
input_file_type = input_file_subtype = None
|
input_file_type = input_file_subtype = None
|
||||||
|
|
||||||
# in case python-magic fails to detect file type
|
# in case python-magic fails to detect file type
|
||||||
@ -899,7 +899,7 @@ class Video2XMainWindow(QMainWindow):
|
|||||||
input_file_mime_type = magic.from_file(str(input_path.absolute()), mime=True)
|
input_file_mime_type = magic.from_file(str(input_path.absolute()), mime=True)
|
||||||
input_file_type = input_file_mime_type.split('/')[0]
|
input_file_type = input_file_mime_type.split('/')[0]
|
||||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||||
except magic.magic.MagicException:
|
except Exception:
|
||||||
input_file_type = input_file_subtype = None
|
input_file_type = input_file_subtype = None
|
||||||
|
|
||||||
# in case python-magic fails to detect file type
|
# in case python-magic fails to detect file type
|
||||||
|
Loading…
Reference in New Issue
Block a user