Merge branch 'master' of mara.ddp.net:photoassistant
This commit is contained in:
5
README
5
README
@@ -1,6 +1,11 @@
|
|||||||
In here we can put instructions on how to run this / any general info
|
In here we can put instructions on how to run this / any general info
|
||||||
|
|
||||||
|
|
||||||
|
ubuntu packages:
|
||||||
|
sudo apt-get install -y mediainfo
|
||||||
|
|
||||||
pip packages:
|
pip packages:
|
||||||
* pymediainfo
|
* pymediainfo
|
||||||
* PIL (should be there by default)
|
* PIL (should be there by default)
|
||||||
* ExifRead
|
* ExifRead
|
||||||
|
*
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ from settings import Settings
|
|||||||
# Utility Functions for Files
|
# Utility Functions for Files
|
||||||
################################################################################
|
################################################################################
|
||||||
def md5(fname):
|
def md5(fname):
|
||||||
print("Trying to MD5 - {}".format(fname))
|
|
||||||
hash_md5 = hashlib.md5()
|
hash_md5 = hashlib.md5()
|
||||||
with open(fname, "rb") as f:
|
with open(fname, "rb") as f:
|
||||||
for chunk in iter(lambda: f.read(4096), b""):
|
for chunk in iter(lambda: f.read(4096), b""):
|
||||||
@@ -79,7 +78,6 @@ def photos():
|
|||||||
fsize = round(os.stat(file).st_size/(1024*1024))
|
fsize = round(os.stat(file).st_size/(1024*1024))
|
||||||
view_list.append( Photos( name=file, type=ftype, size_MB=fsize, hash=fhash ))
|
view_list.append( Photos( name=file, type=ftype, size_MB=fsize, hash=fhash ))
|
||||||
|
|
||||||
print(file_list)
|
|
||||||
return render_template("photos.html", page_title='View Photos', view_path=view_path, file_list=view_list, alert=st.GetAlert(), message=st.GetMessage() )
|
return render_template("photos.html", page_title='View Photos', view_path=view_path, file_list=view_list, alert=st.GetAlert(), message=st.GetMessage() )
|
||||||
|
|
||||||
|
|
||||||
@@ -88,7 +86,6 @@ def isImage(file):
|
|||||||
img = Image.open(file)
|
img = Image.open(file)
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
print('not an image')
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def isVideo(file):
|
def isVideo(file):
|
||||||
@@ -98,5 +95,5 @@ def isVideo(file):
|
|||||||
if track.track_type == "Video":
|
if track.track_type == "Video":
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
except:
|
except Exception as e:
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
<i class="fas fa-question-circle"></i>
|
<i class="fas fa-question-circle"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{obj.name}}
|
{{obj.name}}
|
||||||
|
{% if obj.type=="Image" %}
|
||||||
|
<img width="64" height="64" src="data:image/gif;base64,{{obj.thumb}}"></img>
|
||||||
|
{% endif %}
|
||||||
</td></td><td>{{obj.size_MB}}</td><td>{{obj.hash}}</tr>
|
</td></td><td>{{obj.size_MB}}</td><td>{{obj.hash}}</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|||||||
Reference in New Issue
Block a user