Merge branch 'develop' into preview
This commit is contained in:
commit
54e67e8d2d
21 changed files with 445 additions and 289 deletions
|
@ -14,7 +14,7 @@ To keep it simple, we only have three basic rules:
|
|||
The following non-exhaustive list provides specific guidelines and examples:
|
||||
|
||||
- be respectful, be responsible, be kind
|
||||
- avoid asking for deadlines
|
||||
- avoid asking for [deadlines](https://docs.photoprism.app/developer-guide/code-quality/#go-slow-before-you-go-fast)
|
||||
- don't feel entitled to free support, advice, or features if you are not a [contributor](https://docs.photoprism.app/developer-guide/), [sponsor](https://docs.photoprism.app/funding/), or paying customer
|
||||
- before reporting a bug, try to [determine the cause of your problem](https://docs.photoprism.app/getting-started/troubleshooting/)
|
||||
- if you have a [general question](https://github.com/photoprism/photoprism/discussions) or need [technical support](https://docs.photoprism.app/user-guide/#getting-support), don't use GitHub Issues
|
||||
|
|
|
@ -30,15 +30,13 @@ must be fixed directly in [our source code](https://github.com/photoprism/photop
|
|||
|
||||
## Submitting Pull Requests ##
|
||||
|
||||
Because we want to create the best possible product for our users, we have a [set of guidelines](https://docs.photoprism.app/developer-guide/pull-requests) to ensure that all submissions are acceptable.
|
||||
Because we want to create the best possible product for our users, we have a [set of criteria](https://docs.photoprism.app/developer-guide/pull-requests#acceptance-criteria) to ensure that all submissions are acceptable.
|
||||
|
||||
They include step-by-step instructions for submitting new features,
|
||||
bug fixes, and documentation improvements.
|
||||
Issues labeled [help wanted](https://github.com/photoprism/photoprism/labels/help%20wanted) /
|
||||
Follow our [step-by-step guide](https://docs.photoprism.app/developer-guide/pull-requests#how-to-create-and-submit-a-pull-request) to learn how to submit
|
||||
new features, bug fixes, and documentation improvements. Issues labeled [help wanted](https://github.com/photoprism/photoprism/labels/help%20wanted) /
|
||||
[easy](https://github.com/photoprism/photoprism/labels/easy) can be good (first) contributions.
|
||||
|
||||
**Reviewing, testing and finally merging pull requests requires significant resources
|
||||
on our side. If it's not just a small fix, it can take several months.**
|
||||
**Reviewing, testing and finally merging pull requests requires significant resources on our side. If it's not just a small fix, it can take several months.**
|
||||
|
||||
### Contributor License Agreement (CLA) ###
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM photoprism/develop:20220116
|
||||
FROM photoprism/develop:20220202
|
||||
|
||||
# Copy latest entrypoint script
|
||||
COPY --chown=root:root /docker/develop/entrypoint.sh /entrypoint.sh
|
||||
|
|
|
@ -65,7 +65,7 @@ We currently have the following sponsorship options:
|
|||
- [GitHub Sponsors](https://github.com/sponsors/photoprism) is priced in USD and also offers [one-time donations](https://github.com/sponsors/photoprism?frequency=one-time)
|
||||
- [Patreon](https://www.patreon.com/photoprism) is priced in Euro and also offers yearly payments
|
||||
- Stripe will be available in early 2022, so you can sign up directly in the app without having a Patreon or GitHub account
|
||||
- you are welcome to [contact us](https://photoprism.app/contact) for [other options](SPONSORS.md#crypto-wallets)
|
||||
- you are welcome to [contact us](https://photoprism.app/contact) for [crypto donations](SPONSORS.md#crypto-donations) and other options
|
||||
|
||||
Also, please [leave a star](https://github.com/photoprism/photoprism/stargazers) on GitHub if you like this project.
|
||||
It provides additional motivation to keep going.
|
||||
|
@ -100,7 +100,7 @@ In addition, [sponsors](https://github.com/photoprism/photoprism/blob/develop/SP
|
|||
|
||||
We'll do our best to answer all your questions. In return, we ask you to [back us](https://docs.photoprism.app/funding/)
|
||||
on [Patreon](https://www.patreon.com/photoprism) or [GitHub Sponsors](https://github.com/sponsors/photoprism).
|
||||
Think of "free software" as in "free speech," not as in "free beer". Thank you! 💜
|
||||
Think of "free software" as in "free speech," not as in "free beer". Thank You! 💜
|
||||
|
||||
### GitHub Issues ###
|
||||
|
||||
|
|
15
SPONSORS.md
15
SPONSORS.md
|
@ -72,15 +72,12 @@ William Kray, Ovace Mamnoon, Clément Caplain Moreau, The Gordon Project, [@pluj
|
|||
|
||||
[Learn more about one-time donation options through GitHub Sponsors.](https://github.com/sponsors/photoprism?frequency=one-time)
|
||||
|
||||
## Crypto Wallets ##
|
||||
## Crypto Donations ##
|
||||
|
||||
We are happy to accept donations in cryptocurrency via the following addresses:
|
||||
Donations in Monero (XMR) and IOTA (MIOTA) can be made to the following wallet addresses:
|
||||
|
||||
| Currency | Address |
|
||||
|:----------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Ethereum | [`0x04e73F3326E26916356f76b04ca15e0c4C2d9C79`](ethereum:0x04e73F3326E26916356f76b04ca15e0c4C2d9C79) |
|
||||
| Bitcoin | [`bc1qfdjqauera5cm243h3yadwrnena0mxusafvchzr`](bitcoin:bc1qfdjqauera5cm243h3yadwrnena0mxusafvchzr) |
|
||||
| Monero | [`474qhuQzC59g4i7cn8mN9VeRGRJHvChmUhL5Fh53hntah63QzB7ERxEb5woVvJkc1KZuGZ3GsGh7d5w9d6SUBHmrUzGeEWT`](monero:474qhuQzC59g4i7cn8mN9VeRGRJHvChmUhL5Fh53hntah63QzB7ERxEb5woVvJkc1KZuGZ3GsGh7d5w9d6SUBHmrUzGeEWT) |
|
||||
| Dogecoin | [`DKf8bFPaUYdJ5fkjtJNY1jMjtRtiXi3Vzy`](dogecoin:DKf8bFPaUYdJ5fkjtJNY1jMjtRtiXi3Vzy) |
|
||||
| Monero | `474qhuQzC59g4i7cn8mN9VeRGRJHvChmUhL5Fh53hntah63QzB7ERxEb5woVvJkc1KZuGZ3GsGh7d5w9d6SUBHmrUzGeEWT` |
|
||||
|-----------|---------------------------------------------------------------------------------------------------|
|
||||
| IOTA | `iota1qrcspztm2v2nldpuysq5j5fydn8ulyrnhr86qjymxwmmvzax8zlw7g0jyww` |
|
||||
|
||||
Sponsors are welcome to [contact us](https://photoprism.app/contact) for technical support and assistance with enabling sponsor features.
|
||||
Please [contact us by email](https://photoprism.app/contact) with a reference to the transaction so we can help you unlock additional features and provide technical support. Thank You! :)
|
||||
|
|
|
@ -93,8 +93,8 @@ curl -fsSL https://dl.photoprism.app/docker/demo/Makefile > /opt/photoprism/Make
|
|||
chown -Rf photoprism:photoprism /opt/photoprism
|
||||
|
||||
# clear package cache
|
||||
apt-get autoclean
|
||||
apt-get autoremove
|
||||
apt-get -y autoclean
|
||||
apt-get -y autoremove
|
||||
|
||||
# start services using docker-compose
|
||||
(cd /opt/photoprism && make install)
|
||||
|
|
|
@ -34,7 +34,7 @@ COPY --chown=root:root --chmod=755 /docker/scripts/*.sh /root/.local/bin/
|
|||
# 2. Install TensorFlow for C
|
||||
# 3. Install Chrome, NodeJS, NPM, Puppeteer, TestCafe & ChromeDriver
|
||||
# 4. Install Go
|
||||
RUN apt-get update && apt-get -qq dist-upgrade && apt dist-upgrade 2>/dev/null && apt-get -qq install --no-install-recommends \
|
||||
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
wget \
|
||||
|
|
|
@ -33,7 +33,7 @@ COPY --chown=root:root --chmod=755 /docker/scripts/*.sh /root/.local/bin/
|
|||
# 2. Install TensorFlow for C
|
||||
# 3. Install Chrome, NodeJS, NPM, Puppeteer, TestCafe & ChromeDriver
|
||||
# 4. Install Go
|
||||
RUN apt-get update && apt-get -qq dist-upgrade && apt dist-upgrade 2>/dev/null && apt-get -qq install --no-install-recommends \
|
||||
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
wget \
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Install ufw package if needed:
|
||||
apt-get update && apt-get install --no-install-recommends ufw && apt-get autoclean && apt-get autoremove
|
||||
apt-get update && apt-get -y install --no-install-recommends ufw && apt-get -y autoclean && apt-get -y autoremove
|
||||
|
||||
# Basic ufw firewall setup allowing ssh, http, and https:
|
||||
ufw default deny incoming
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
##################################################### BUILD STAGE ######################################################
|
||||
FROM photoprism/develop:20220116 as build
|
||||
FROM photoprism/develop:20220202 as build
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG TARGETPLATFORM
|
||||
|
@ -34,7 +34,7 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
|||
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
|
||||
|
||||
# Install additional distribution packages
|
||||
RUN apt-get update && apt-get -qq dist-upgrade && apt dist-upgrade 2>/dev/null && apt-get -qq install --no-install-recommends \
|
||||
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
|
||||
gpgv \
|
||||
wget \
|
||||
curl \
|
||||
|
@ -57,8 +57,8 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt dist-upgrade 2>/dev/null &
|
|||
ffmpeg \
|
||||
ffmpegthumbnailer \
|
||||
libavcodec-extra && \
|
||||
[ "$TARGETARCH" = "arm" ] || apt-get install darktable; \
|
||||
apt-get -y autoremove && apt-get -y autoclean && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
[ "$TARGETARCH" = "arm" ] || apt-get -y install darktable; \
|
||||
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set environment variables, see https://docs.photoprism.app/getting-started/config-options/
|
||||
ENV TF_CPP_MIN_LOG_LEVEL="2" \
|
||||
|
|
|
@ -34,7 +34,7 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
|||
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
|
||||
|
||||
# Install additional distribution packages
|
||||
RUN apt-get update && apt-get -qq dist-upgrade && apt dist-upgrade 2>/dev/null && apt-get -qq install --no-install-recommends \
|
||||
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
|
||||
gpgv \
|
||||
wget \
|
||||
curl \
|
||||
|
|
|
@ -12,12 +12,12 @@ tensorflow-amd64-cpu: /tmp/libtensorflow-linux-cpu-1.15.2.tar.gz tensorflow-amd6
|
|||
tensorflow-amd64-avx: /tmp/libtensorflow-linux-avx-1.15.2.tar.gz tensorflow-amd64-avx-install
|
||||
tensorflow-amd64-avx2: /tmp/libtensorflow-linux-avx2-1.15.2.tar.gz tensorflow-amd64-avx2-install
|
||||
apt-upgrade:
|
||||
apt-get update
|
||||
apt-get dist-upgrade
|
||||
apt-get -y update
|
||||
apt-get -y dist-upgrade
|
||||
apt-cleanup:
|
||||
apt-get -y autoremove && apt-get -y autoclean && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/*
|
||||
install-intel-graphics:
|
||||
apt-get install intel-opencl-icd intel-media-va-driver-non-free i965-va-driver-shaders libmfx1
|
||||
apt-get -y install intel-opencl-icd intel-media-va-driver-non-free i965-va-driver-shaders libmfx1
|
||||
/tmp/libtensorflow-linux-cpu-1.15.2.tar.gz:
|
||||
curl -fsSL "https://dl.photoprism.app/tensorflow/linux/libtensorflow-linux-cpu-1.15.2.tar.gz" > /tmp/libtensorflow-linux-cpu-1.15.2.tar.gz
|
||||
tensorflow-amd64-cpu-install:
|
||||
|
|
18
docker/scripts/dist-upgrade.sh
Executable file
18
docker/scripts/dist-upgrade.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# check if user is root
|
||||
if [[ $(id -u) != "0" ]]; then
|
||||
echo "failed, please run as root" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# fail on errors
|
||||
set -eu
|
||||
|
||||
# disable user interactions
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
export TMPDIR="/tmp"
|
||||
|
||||
apt-get -y update
|
||||
apt-get -y dist-upgrade
|
||||
apt-get -y autoremove
|
|
@ -38,7 +38,7 @@ EOF
|
|||
# Remove package files
|
||||
apt-get -y autoremove
|
||||
apt-get -y autoclean
|
||||
apt-get clean
|
||||
apt-get -y clean
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install NPM
|
||||
|
|
551
frontend/package-lock.json
generated
551
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -34,7 +34,7 @@
|
|||
"@babel/runtime": "^7.16.7",
|
||||
"@lcdp/offline-plugin": "^5.1.0",
|
||||
"@vvo/tzdb": "^6.44.0",
|
||||
"axios": "^0.24.0",
|
||||
"axios": "^0.25.0",
|
||||
"axios-mock-adapter": "^1.19.0",
|
||||
"babel-loader": "^8.2.3",
|
||||
"babel-plugin-istanbul": "^6.1.1",
|
||||
|
@ -48,7 +48,7 @@
|
|||
"easygettext": "^2.17.0",
|
||||
"eslint": "^8.7.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-config-standard": "^17.0.0-0",
|
||||
"eslint-config-standard": "^17.0.0-1",
|
||||
"eslint-formatter-pretty": "^4.1.0",
|
||||
"eslint-friendly-formatter": "^4.0.1",
|
||||
"eslint-plugin-html": "^6.2.0",
|
||||
|
@ -68,12 +68,12 @@
|
|||
"karma-coverage-istanbul-reporter": "^3.0.3",
|
||||
"karma-htmlfile-reporter": "^0.3.8",
|
||||
"karma-mocha": "^2.0.1",
|
||||
"karma-verbose-reporter": "^0.0.6",
|
||||
"karma-verbose-reporter": "^0.0.8",
|
||||
"karma-webpack": "^5.0.0",
|
||||
"luxon": "^2.3.0",
|
||||
"mapbox-gl": "^1.13.2",
|
||||
"material-design-icons-iconfont": "^6.1.1",
|
||||
"mini-css-extract-plugin": "2.5.2",
|
||||
"mini-css-extract-plugin": "^2.5.3",
|
||||
"minimist": ">=1.2.5",
|
||||
"mocha": "^9.0.2",
|
||||
"node-storage-shim": "^2.0.1",
|
||||
|
@ -107,7 +107,7 @@
|
|||
"vue-router": "^3.5.2",
|
||||
"vue-style-loader": "^4.1.3",
|
||||
"vue-template-compiler": "^2.6.14",
|
||||
"vue2-filters": "^0.13.0",
|
||||
"vue2-filters": "^0.14.0",
|
||||
"vuetify": "^1.5.24",
|
||||
"webpack": "^5.66.0",
|
||||
"webpack-bundle-analyzer": "^4.5.0",
|
||||
|
|
6
go.mod
6
go.mod
|
@ -30,7 +30,7 @@ require (
|
|||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
|
||||
github.com/karrick/godirwalk v1.16.1
|
||||
github.com/klauspost/cpuid/v2 v2.0.9
|
||||
github.com/klauspost/cpuid/v2 v2.0.10
|
||||
github.com/leandro-lugaresi/hub v1.1.1
|
||||
github.com/leonelquinteros/gotext v1.5.0
|
||||
github.com/lib/pq v1.8.0 // indirect
|
||||
|
@ -50,11 +50,11 @@ require (
|
|||
github.com/stretchr/testify v1.7.0
|
||||
github.com/studio-b12/gowebdav v0.0.0-20211106090535-29e74efa701f
|
||||
github.com/tensorflow/tensorflow v1.15.2
|
||||
github.com/tidwall/gjson v1.13.0
|
||||
github.com/tidwall/gjson v1.14.0
|
||||
github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6
|
||||
github.com/urfave/cli v1.22.5
|
||||
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
|
||||
golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed
|
||||
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838
|
||||
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 // indirect
|
||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
|
||||
|
|
12
go.sum
12
go.sum
|
@ -190,8 +190,8 @@ github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALr
|
|||
github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw=
|
||||
github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.0.10 h1:fv5GKR+e2UgD+gcxQECVT5rBwAmlFLl2mkKm7WK3ODY=
|
||||
github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
|
@ -279,8 +279,8 @@ github.com/studio-b12/gowebdav v0.0.0-20211106090535-29e74efa701f h1:SLJx0nHhb2Z
|
|||
github.com/studio-b12/gowebdav v0.0.0-20211106090535-29e74efa701f/go.mod h1:gCcfDlA1Y7GqOaeEKw5l9dOGx1VLdc/HuQSlQAaZ30s=
|
||||
github.com/tensorflow/tensorflow v1.15.2 h1:7/f/A664Tml/nRJg04+p3StcrsT53mkcvmxYHXI21Qo=
|
||||
github.com/tensorflow/tensorflow v1.15.2/go.mod h1:itOSERT4trABok4UOoG+X4BoKds9F3rIsySdn+Lvu90=
|
||||
github.com/tidwall/gjson v1.13.0 h1:3TFY9yxOQShrvmjdM76K+jc66zJeT6D3/VFFYCGQf7M=
|
||||
github.com/tidwall/gjson v1.13.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/gjson v1.14.0 h1:6aeJ0bzojgWLa82gDQHcx3S0Lr/O51I9bJ5nv6JFx5w=
|
||||
github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
|
||||
|
@ -310,8 +310,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
|
|||
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed h1:YoWVYYAfvQ4ddHv3OKmIvX7NCAhFGTj62VP2l2kfBbA=
|
||||
golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 h1:71vQrMauZZhcTVK6KdYM+rklehEEwb3E+ZhaE5jrPrE=
|
||||
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
|
|
|
@ -55,7 +55,7 @@ func (data *Data) Exif(fileName string, fileType fs.FileFormat) (err error) {
|
|||
}
|
||||
}()
|
||||
|
||||
// Extract raw EXIF block.
|
||||
// Extract raw Exif block.
|
||||
rawExif, err := RawExif(fileName, fileType)
|
||||
|
||||
if err != nil {
|
||||
|
@ -68,7 +68,7 @@ func (data *Data) Exif(fileName string, fileType fs.FileFormat) (err error) {
|
|||
data.All = make(map[string]string)
|
||||
}
|
||||
|
||||
// Enumerate tags in EXIF block.
|
||||
// Enumerate tags in Exif block.
|
||||
opt := exif.ScanOptions{}
|
||||
entries, _, err := exif.GetFlatExifData(rawExif, &opt)
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ func RawExif(fileName string, fileType fs.FileFormat) (rawExif []byte, err error
|
|||
}
|
||||
}()
|
||||
|
||||
// Extract raw EXIF block.
|
||||
// Extract raw Exif block.
|
||||
var parsed bool
|
||||
|
||||
logName := sanitize.Log(filepath.Base(fileName))
|
||||
|
@ -56,18 +56,18 @@ func RawExif(fileName string, fileType fs.FileFormat) (rawExif []byte, err error
|
|||
|
||||
if err != nil {
|
||||
return rawExif, fmt.Errorf("metadata: %s in %s (parse png)", err, logName)
|
||||
}
|
||||
|
||||
_, rawExif, err = cs.Exif()
|
||||
|
||||
if err != nil {
|
||||
if err.Error() == "file does not have EXIF" {
|
||||
return rawExif, fmt.Errorf("metadata: found no exif header in %s (parse png)", logName)
|
||||
} else {
|
||||
log.Infof("metadata: %s in %s (parse png)", err, logName)
|
||||
}
|
||||
} else {
|
||||
parsed = true
|
||||
_, rawExif, err = cs.Exif()
|
||||
|
||||
if err != nil {
|
||||
if err.Error() == "file does not have EXIF" || strings.HasPrefix(err.Error(), "no exif data") {
|
||||
return rawExif, fmt.Errorf("metadata: found no exif header in %s (parse png)", logName)
|
||||
} else {
|
||||
log.Infof("metadata: %s in %s (parse png)", err, logName)
|
||||
}
|
||||
} else {
|
||||
parsed = true
|
||||
}
|
||||
}
|
||||
} else if fileType == fs.FormatHEIF {
|
||||
heicMp := heicexif.NewHeicExifMediaParser()
|
||||
|
@ -76,18 +76,18 @@ func RawExif(fileName string, fileType fs.FileFormat) (rawExif []byte, err error
|
|||
|
||||
if err != nil {
|
||||
return rawExif, fmt.Errorf("metadata: %s in %s (parse heic)", err, logName)
|
||||
}
|
||||
|
||||
_, rawExif, err = cs.Exif()
|
||||
|
||||
if err != nil {
|
||||
if err.Error() == "file does not have EXIF" {
|
||||
return rawExif, fmt.Errorf("metadata: found no exif header in %s (parse heic)", logName)
|
||||
} else {
|
||||
log.Infof("metadata: %s in %s (parse heic)", err, logName)
|
||||
}
|
||||
} else {
|
||||
parsed = true
|
||||
_, rawExif, err = cs.Exif()
|
||||
|
||||
if err != nil {
|
||||
if err.Error() == "file does not have EXIF" || strings.HasPrefix(err.Error(), "no exif data") {
|
||||
return rawExif, fmt.Errorf("metadata: found no exif header in %s (parse heic)", logName)
|
||||
} else {
|
||||
log.Infof("metadata: %s in %s (parse heic)", err, logName)
|
||||
}
|
||||
} else {
|
||||
parsed = true
|
||||
}
|
||||
}
|
||||
} else if fileType == fs.FormatTiff {
|
||||
tiffMp := tiffstructure.NewTiffMediaParser()
|
||||
|
@ -96,18 +96,18 @@ func RawExif(fileName string, fileType fs.FileFormat) (rawExif []byte, err error
|
|||
|
||||
if err != nil {
|
||||
return rawExif, fmt.Errorf("metadata: %s in %s (parse tiff)", err, logName)
|
||||
}
|
||||
|
||||
_, rawExif, err = cs.Exif()
|
||||
|
||||
if err != nil {
|
||||
if err.Error() == "file does not have EXIF" {
|
||||
return rawExif, fmt.Errorf("metadata: found no exif header in %s (parse tiff)", logName)
|
||||
} else {
|
||||
log.Infof("metadata: %s in %s (parse tiff)", err, logName)
|
||||
}
|
||||
} else {
|
||||
parsed = true
|
||||
_, rawExif, err = cs.Exif()
|
||||
|
||||
if err != nil {
|
||||
if err.Error() == "file does not have EXIF" || strings.HasPrefix(err.Error(), "no exif data") {
|
||||
return rawExif, fmt.Errorf("metadata: found no exif header in %s (parse tiff)", logName)
|
||||
} else {
|
||||
log.Infof("metadata: %s in %s (parse tiff)", err, logName)
|
||||
}
|
||||
} else {
|
||||
parsed = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ func TestExif(t *testing.T) {
|
|||
t.Fatal("err should NOT be nil")
|
||||
}
|
||||
|
||||
assert.Equal(t, "metadata: found no exif header in tweethog.png (search and extract)", err.Error())
|
||||
assert.Equal(t, "metadata: found no exif header in tweethog.png (parse png)", err.Error())
|
||||
})
|
||||
|
||||
t.Run("iphone_7.heic", func(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue