Compare commits

...

8 Commits

13 changed files with 39 additions and 33 deletions

View File

@@ -2,10 +2,7 @@ images_to_process
new_img_dir
photos
reference_images
static/Bin/*
static/Import/*
static/Storage/*
static/Metadata/*
static
.pa_metadata
.pa_bin
.python

6
BUGs
View File

@@ -1,4 +1,4 @@
### Next: 137
### Next: 138
BUG-100: I managed to get 2 photos matching mich in the NOT_WORKING photo (probably dif refimgs but same p.tag?)
= /photos/2012/20120414-damien/IMG_8467.JPG
BUG-106: cant add trudy /pat? as refimgs via FaceDBox
@@ -26,7 +26,6 @@ BUG-134: when moving set of photos on page, then move another set of photos on p
BUG-135: failed to rotate: 2006/20061215-ITS-xmas-KP/DSC00582.JPG - not sure why && not repeatable, so its not the image, timing/race condition maybe?
Example of issue when I restart and lose state:
id | job_id | level | message | cant_close | persistent
@@ -57,3 +56,6 @@ Sorry, viewing data is confused, cannot view this image nowClearing out all stat
Also, rotated this image: dcp_0975.jpg -> 90deg, and it seemed to flip 180
BUG-137: after moving/refiling photos, the next shift-click is out of order (reload fixes it)

View File

@@ -4,31 +4,24 @@ FROM python:latest
ARG PA_ID
WORKDIR /code
RUN groupadd -g ${PA_ID} pauser && useradd -r -u ${PA_ID} -g ${PA_ID} pauser
# do this first, allowing layer / build efficiencies if only code changes...
# sudo used in dev container
RUN apt-get update && apt-get -y install libpq-dev mediainfo cmake libgl1-mesa-glx libglib2.0-0 libjpeg-turbo-progs ffmpeg git sudo
COPY requirements.txt .
RUN pip3 install --upgrade pip && pip3 install -r requirements.txt && pip3 install --upgrade pillow
RUN groupadd -g ${PA_ID} pauser && useradd -r -u ${PA_ID} -g ${PA_ID} pauser
# NOW, deal with any code changes, and reset the container for 'first run'...
COPY . .
# be explicity with this special directory, don't presume the COPY . . above
# has set things up perfectly from DEV to PROD
RUN rm -rf static
RUN mkdir -p static/Bin
RUN mkdir -p static/Import
RUN mkdir -p static/Storage
RUN mkdir -p static/Metadata
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt
RUN pip3 install --upgrade pillow --user
# set up static dir and subdirs
RUN mkdir -p static/Bin && mkdir static/Import && mkdir static/Storage && mkdir static/Metadata
EXPOSE 80
RUN cat /dev/urandom | head -c 50 | md5sum | head -c 32 > /code/.sk
RUN chmod 600 .sk
RUN date > internal/build-date.txt
RUN git log -n 15 > internal/git-log.txt
RUN ln -s /code/TODO /code/internal/TODO
RUN ln -s /code/BUGs /code/internal/BUGs
RUN cat /dev/urandom | head -c 50 | md5sum | head -c 32 > /code/.sk && chmod 600 .sk && chown pauser:pauser .sk
RUN date > internal/build-date.txt && git log -n 15 > internal/git-log.txt && ln -s /code/TODO /code/internal/TODO && ln -s /code/BUGs /code/internal/BUGs
RUN rm -rf .git
RUN chown pauser:pauser /code
RUN chown pauser:pauser ./static
RUN chown pauser:pauser ./static/*
RUN chown pauser:pauser /code && chown pauser:pauser ./static && chown pauser:pauser ./static/*
CMD ["./wrapper.sh"]

21
TODO
View File

@@ -1,9 +1,12 @@
### GENERAL
* rm dups job should show progress bar
* in viewer, there is no move button (maybe add one?)
* consider doing duplicates before AI, and if there are say 100s+, then maybe pause the AI work
- had 5000+ new photos, took 8 hours to finish, for me to just delete them anyway
* optimisation:
keep track of just new files since scan (even if we did this from the DB),
- keep track of just new files since scan (even if we did this from the DB),
then we could just feed those eid's explicitly into a 'get_file_details_on_new_files'.
ALSO use new_eids list IF no new refimgs to do a 'run_ai_on_new_files' :)
- ALSO use new_eids list IF no new refimgs to do a 'run_ai_on_new_files' :)
* allow changing dates in move dbox and then re-scan for existing folders OR just have a browse for existing...
- for use on scanned photos, they register as 2010, but are datestamped in visuals for 95
@@ -16,6 +19,18 @@
* allow actions for wrong person:
-> someone else? OR override no match for this person ever for this image?
* groups of persons (non-exclusive, recursive), so:
- fam (ddp, mandy, cam, mich)
- mandy_fam (mandy, kirsty, tony, anne, tenille)
- uncle_peters_fam (peter, joan, jarrod, aaron, alana)
- cousin_aarons_fam (aaron, karly, kai, etc)
- storviks (mandy_fam, uncle_peters_fam, cousin_aarons_fam, etc)
* birthdates in PA:
- M was interested in birthdate appearing in hass, so need an API /
sensor in hass too - maybe could store (optional) birthdate and
heads up (of X days, e.g. so can get present) or just come up on the day so you can remember to text them
* search logic (AND vs OR)
* read this: https://flask.palletsprojects.com/en/2.2.x/testing/#faking-resources-and-context

BIN
internal/pa-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@@ -87,7 +87,7 @@ class States(PA):
st=''
pref=PA_UserState.query.filter(PA_UserState.pa_user_dn==current_user.dn,PA_UserState.path_type==self.path_type,PA_UserState.view_eid==self.view_eid,PA_UserState.orig_search_term==st).first()
if not pref:
SetFELog( message=f"ERROR: pref not found - dn={current_user.dn}, st={st}, s={self}????" , level="danger", persistent=True, cant_close=True )
SetFELog( message=f"ERROR: pref not found - dn={current_user.dn}, st={st}, s={self}????" , level="danger", persistent=True, cant_close=False )
SetFELog( message=f"WARNING: I think this error occurred because you reloaded a page and the server had restarted between your original page load and this page reload, is that possible?" , level="warning", persistent=True, cant_close=False )
redirect("/")
else:

View File

@@ -46,8 +46,7 @@
<div class="row px-3 my-5 offset-lg-3 col-lg-6 col-sm-12" style="border: 3px solid #5bc0de; border-radius: 15px;">
<h3 class="my-3 text-center" style="color: #5bc0de">
{# <svg width="64" height="64" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#pa_logo" /></svg>&nbsp;Photo Assistant Login</h3> #}
<svg width="64" height="64" fill="currentColor"><use xlink:href="internal/icons.svg#pa_logo" /></svg>&nbsp;Photo Assistant Login</h3>
<img width="64" height="64" src="internal/pa-logo.png"/></img>&nbsp;Photo Assistant Login</h3>
<form class="" method="POST">
<div class="input-group">
<label for="username" class="text-right input-group-text col-4 text-info">Username:</label>