diff --git a/INSTALL.debian b/INSTALL.debian index c4278aad7..46b78bf8d 100644 --- a/INSTALL.debian +++ b/INSTALL.debian @@ -49,7 +49,7 @@ apt-get -y install $LIBSSL_DEV_PKG build-essential automake libxml2-dev libxslt- apt-get -y install libpq-dev postgresql-client apt-get -y install liblcms2-dev $LIBJPEG_TURBO_DEV_PKG libexpat1-dev libgif-dev libpng-dev libexif-dev apt-get -y install gcc g++ -apt-get -y install exiftool +apt-get -y install exiftool perl perl-modules curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list diff --git a/config/docker/build-base-image.sh b/config/docker/build-base-image.sh index d6628d11a..9d3a76f38 100755 --- a/config/docker/build-base-image.sh +++ b/config/docker/build-base-image.sh @@ -21,9 +21,7 @@ DANBOORU_RUNTIME_DEPS=" ca-certificates mkvtoolnix postgresql-client-12 libpq5 zlib1g libfftw3-3 libwebp6 libwebpmux3 libwebpdemux2 liborc-0.4.0 liblcms2-2 libpng16-16 libjpeg-turbo8 libexpat1 libglib2.0 libgif7 libexif12 libvpx6 -" -EXTRA_DEPS=" - busybox + perl perl-modules busybox " apt_install() { @@ -64,6 +62,8 @@ install_ffmpeg() { ffprobe -version } +# https://github.com/exiftool/exiftool/blob/master/README +# Optional dependencies: Compress::Zlib (for SWF files), Archive::Zip (ZIP), Digest::MD5 install_exiftool() { EXIFTOOL_URL="https://github.com/exiftool/exiftool/archive/refs/tags/${EXIFTOOL_VERSION}.tar.gz" curl -L "$EXIFTOOL_URL" | tar -C /usr/local/src -xzvf - @@ -73,6 +73,9 @@ install_exiftool() { make -j "$(nproc)" install exiftool -ver + perl -e 'require Compress::Zlib' || exit 1 + perl -e 'require Archive::Zip' || exit 1 + perl -e 'require Digest::MD5' || exit 1 } install_ruby() { @@ -126,7 +129,7 @@ cleanup() { } apt-get update -apt_install $COMMON_BUILD_DEPS $DANBOORU_RUNTIME_DEPS $EXTRA_DEPS +apt_install $COMMON_BUILD_DEPS $DANBOORU_RUNTIME_DEPS install_asdf install_exiftool install_ffmpeg diff --git a/test/unit/media_file_test.rb b/test/unit/media_file_test.rb index ee56aa02d..a9ed28065 100644 --- a/test/unit/media_file_test.rb +++ b/test/unit/media_file_test.rb @@ -180,6 +180,16 @@ class MediaFileTest < ActiveSupport::TestCase end end + context "a compressed SWF file" do + should "get all the metadata" do + @metadata = MediaFile.open("test/files/compressed.swf").metadata + + assert_equal(true, @metadata["Flash:Compressed"]) + assert_not_equal("Install Compress::Zlib to extract compressed information", @metadata["ExifTool:Warning"]) + assert_equal(6, @metadata.count) + end + end + context "a greyscale image without an embedded color profile" do should "successfully generate a thumbnail" do @image = MediaFile.open("test/files/test-grey-no-profile.jpg")