Merge branch 'master' of mara.ddp.net:photoassistant

This commit is contained in:
2021-01-10 17:50:54 +11:00
3 changed files with 10 additions and 5 deletions

5
README
View File

@@ -1,6 +1,11 @@
In here we can put instructions on how to run this / any general info
ubuntu packages:
sudo apt-get install -y mediainfo
pip packages:
* pymediainfo
* PIL (should be there by default)
* ExifRead
*

View File

@@ -21,7 +21,6 @@ from settings import Settings
# Utility Functions for Files
################################################################################
def md5(fname):
print("Trying to MD5 - {}".format(fname))
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
@@ -79,7 +78,6 @@ def photos():
fsize = round(os.stat(file).st_size/(1024*1024))
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() )
@@ -88,7 +86,6 @@ def isImage(file):
img = Image.open(file)
return True
except:
print('not an image')
return False
def isVideo(file):
@@ -98,5 +95,5 @@ def isVideo(file):
if track.track_type == "Video":
return True
return False
except:
except Exception as e:
return False

View File

@@ -16,6 +16,9 @@
<i class="fas fa-question-circle"></i>
{% endif %}
&nbsp;{{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>
{% endfor %}
</tbody></table>