Merge branch 'graphicsmagick' into develop. ref #42
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ matrix:
|
||||
- gcc
|
||||
before_install:
|
||||
- eval "${MATRIX_EVAL}"
|
||||
- sudo apt-get install build-essential cmake libboost-all-dev libconfig++-dev libavcodec-dev libavutil-dev libavformat-dev ffmpeg libmagick++-dev libpstreams-dev libconfig++-dev libpstreams-dev libtag1-dev
|
||||
- sudo apt-get install build-essential cmake libboost-all-dev libconfig++-dev libavcodec-dev libavutil-dev libavformat-dev ffmpeg libgraphicsmagick++1-dev libpstreams-dev libconfig++-dev libpstreams-dev libtag1-dev
|
||||
- git clone https://github.com/emweb/wt.git wt
|
||||
- pushd wt;
|
||||
- git checkout 4.1.0
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
include(CTest)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(IMAGEMAGICKXX REQUIRED ImageMagick++)
|
||||
pkg_check_modules(GRAPHICSMAGICKXX REQUIRED GraphicsMagick++)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ __Notes__:
|
||||
* a C++17 compiler is needed
|
||||
* ffmpeg version 4 minimum is required
|
||||
```sh
|
||||
apt-get install g++ cmake libboost-system-dev libavutil-dev libavformat-dev libmagick++-dev libconfig++-dev libpstreams-dev ffmpeg libtag1-dev
|
||||
apt-get install g++ cmake libboost-system-dev libavutil-dev libavformat-dev libgraphicsmagick++1-dev libconfig++-dev libpstreams-dev ffmpeg libtag1-dev
|
||||
```
|
||||
|
||||
You also need _Wt4_, which is not packaged yet on _Debian_. See [installation instructions](https://www.webtoolkit.eu/wt/doc/reference/html/InstallationUnix.html).</br>
|
||||
@@ -208,6 +208,6 @@ To connect to _LMS_, just open your favorite browser and go to http://localhost:
|
||||
* Wt (http://www.webtoolkit.eu/)
|
||||
* bootstrap3 (http://getbootstrap.com/)
|
||||
* ffmpeg project (https://ffmpeg.org/)
|
||||
* Magick++ (http://www.imagemagick.org/Magick++/)
|
||||
* GraphicsMagick++ (http://www.graphicsmagick.org/)
|
||||
* MetaBrainz (https://metabrainz.org/)
|
||||
* Bootstrap Notify: https://github.com/mouse0270/bootstrap-notify
|
||||
|
||||
+35
-40
@@ -5,7 +5,7 @@ WORKDIR /tmp/workdir
|
||||
ARG MAKEFLAGS="-j2"
|
||||
ARG FFMPEG_VERSION=4.1.4
|
||||
ARG WT_VERSION=4.2.0
|
||||
ARG IMAGEMAGICK6_VERSION=6.9.10-71
|
||||
ARG GRAPHICSMAGICK_VERSION=1.3.35
|
||||
ARG PSTREAMS_VERSION=1.0.1
|
||||
ARG LMS_VERSION=v3.6.3
|
||||
|
||||
@@ -24,6 +24,7 @@ ARG BUILD_PACKAGES=" \
|
||||
make \
|
||||
libjpeg-turbo-dev \
|
||||
openjpeg-dev \
|
||||
jasper-dev \
|
||||
libpng-dev \
|
||||
tiff-dev \
|
||||
nasm \
|
||||
@@ -95,50 +96,42 @@ RUN \
|
||||
make && \
|
||||
make install
|
||||
|
||||
# ImageMagick
|
||||
# GraphicsMagick++
|
||||
RUN \
|
||||
DIR=/tmp/imagemagick && mkdir -p ${DIR} && cd ${DIR} && \
|
||||
curl -sLO https://github.com/ImageMagick/ImageMagick6/archive/${IMAGEMAGICK6_VERSION}.tar.gz && \
|
||||
tar -x --strip-components=1 -f ${IMAGEMAGICK6_VERSION}.tar.gz
|
||||
DIR=/tmp/graphicsmagick && mkdir -p ${DIR} && cd ${DIR} && \
|
||||
curl -sL ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.3/GraphicsMagick-${GRAPHICSMAGICK_VERSION}.tar.gz -o ${GRAPHICSMAGICK_VERSION}.tar.gz && \
|
||||
tar -x --strip-components=1 -f ${GRAPHICSMAGICK_VERSION}.tar.gz
|
||||
|
||||
RUN \
|
||||
DIR=/tmp/imagemagick && mkdir -p ${DIR} && cd ${DIR} && \
|
||||
DIR=/tmp/graphicsmagick && mkdir -p ${DIR} && cd ${DIR} && \
|
||||
./configure \
|
||||
--prefix=${PREFIX} \
|
||||
--enable-shared=yes \
|
||||
--disable-static \
|
||||
--disable-docs \
|
||||
--with-magick-plus-plus \
|
||||
--without-zstd \
|
||||
--without-dps \
|
||||
--without-autotrace \
|
||||
--without-dps \
|
||||
--without-fftw \
|
||||
--without-flif \
|
||||
--without-fpx \
|
||||
--without-djvu \
|
||||
--without-fontconfig \
|
||||
--without-freetype \
|
||||
--without-raqm \
|
||||
--without-gslib \
|
||||
--without-gvc \
|
||||
--without-heic \
|
||||
--without-jbig \
|
||||
--with-jpeg \
|
||||
--without-jxl \
|
||||
--without-lcms \
|
||||
--with-openjp2 \
|
||||
--without-lqr \
|
||||
--with-lzma \
|
||||
--without-openexr \
|
||||
--without-pango \
|
||||
--with-png \
|
||||
--without-raw \
|
||||
--without-rsvg \
|
||||
--with-tiff \
|
||||
--without-webp \
|
||||
--without-wmf \
|
||||
--without-xml && \
|
||||
--enable-static=no \
|
||||
--with-quantum-depth=8 \
|
||||
--with-modules=no \
|
||||
--with-frozenpaths=no \
|
||||
--with-magick-plus-plus=yes \
|
||||
--with-perl=no \
|
||||
--with-bzlib=no \
|
||||
--with-dps=no \
|
||||
--with-fpx=no \
|
||||
--with-jbig=no \
|
||||
--with-webp=no \
|
||||
--with-jp2=yes \
|
||||
--with-jpeg=yes \
|
||||
--with-lcms2=no \
|
||||
--with-lzma=no \
|
||||
--with-png=yes \
|
||||
--with-tiff=yes \
|
||||
--with-trio=no \
|
||||
--with-ttf=no \
|
||||
--with-tcmalloc=no \
|
||||
--with-wmf=no \
|
||||
--with-xml=no \
|
||||
--with-zlib=yes \
|
||||
--with-zstd=no \
|
||||
--with-x=no && \
|
||||
make && \
|
||||
make install && \
|
||||
make distclean
|
||||
@@ -178,7 +171,8 @@ RUN \
|
||||
done && \
|
||||
cp -r ${PREFIX}/lib /tmp/fakeroot/lib && \
|
||||
cp -r ${PREFIX}/share /tmp/fakeroot/share && \
|
||||
LD_LIBRARY_PATH=/tmp/fakeroot/lib /tmp/fakeroot/bin/ffmpeg -buildconf
|
||||
rm -rf /tmp/fakeroot/share/doc && \
|
||||
rm -rf /tmp/fakeroot/share/man
|
||||
|
||||
## Release Stage
|
||||
FROM alpine:3.10 AS release
|
||||
@@ -188,6 +182,7 @@ ARG RUNTIME_PACKAGES=" \
|
||||
openssl \
|
||||
libjpeg-turbo \
|
||||
openjpeg \
|
||||
jasper-libs \
|
||||
libpng \
|
||||
tiff \
|
||||
libogg \
|
||||
|
||||
@@ -10,17 +10,17 @@ target_include_directories(lmscover INTERFACE
|
||||
|
||||
target_include_directories(lmscover PRIVATE
|
||||
include
|
||||
${IMAGEMAGICKXX_INCLUDE_DIRS}
|
||||
${GRAPHICSMAGICKXX_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_compile_options(lmscover PRIVATE
|
||||
${IMAGEMAGICKXX_CFLAGS_OTHER}
|
||||
${GRAPHICSMAGICKXX_CFLAGS_OTHER}
|
||||
)
|
||||
|
||||
target_link_libraries(lmscover PRIVATE
|
||||
lmsav
|
||||
lmsdatabase
|
||||
${IMAGEMAGICKXX_LIBRARIES}
|
||||
${GRAPHICSMAGICKXX_LIBRARIES}
|
||||
)
|
||||
|
||||
install(TARGETS lmscover DESTINATION lib)
|
||||
|
||||
@@ -49,15 +49,13 @@ Grabber::Grabber(const std::filesystem::path& execPath)
|
||||
init(execPath);
|
||||
}
|
||||
|
||||
Grabber::~Grabber()
|
||||
{
|
||||
deinit();
|
||||
}
|
||||
|
||||
void
|
||||
Grabber::setDefaultCover(const std::filesystem::path& p)
|
||||
{
|
||||
if (!_defaultCover.load(p))
|
||||
std::unique_lock lock {_mutex};
|
||||
|
||||
_defaultCover = std::make_unique<Image>();
|
||||
if (!_defaultCover->load(p))
|
||||
throw LmsException("Cannot read default cover file '" + p.string() + "'");
|
||||
}
|
||||
|
||||
@@ -65,12 +63,12 @@ Image
|
||||
Grabber::getDefaultCover(std::size_t size)
|
||||
{
|
||||
LMS_LOG(COVER, DEBUG) << "Getting a default cover using size = " << size;
|
||||
std::unique_lock<std::mutex> lock(_mutex);
|
||||
std::unique_lock lock {_mutex};
|
||||
|
||||
auto it = _defaultCovers.find(size);
|
||||
if (it == _defaultCovers.end())
|
||||
{
|
||||
Image cover = _defaultCover;
|
||||
Image cover = *_defaultCover;
|
||||
|
||||
LMS_LOG(COVER, DEBUG) << "default cover size = " << cover.getSize().width << " x " << cover.getSize().height;
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ namespace CoverArt
|
||||
{
|
||||
public:
|
||||
Grabber(const std::filesystem::path& execPath);
|
||||
~Grabber();
|
||||
|
||||
Grabber(const Grabber&) = delete;
|
||||
Grabber& operator=(const Grabber&) = delete;
|
||||
@@ -63,9 +62,8 @@ namespace CoverArt
|
||||
std::optional<Image> getFromDirectory(const std::filesystem::path& path) const;
|
||||
Image getDefaultCover(std::size_t size);
|
||||
|
||||
Image _defaultCover;
|
||||
|
||||
std::mutex _mutex;
|
||||
std::unique_ptr<Image> _defaultCover;
|
||||
std::map<std::size_t /* size */, Image> _defaultCovers;
|
||||
|
||||
static inline const std::vector<std::filesystem::path> _fileExtensions {".jpg", ".jpeg", ".png", ".bmp"}; // TODO parametrize
|
||||
|
||||
@@ -29,12 +29,6 @@ init(const std::filesystem::path& path)
|
||||
Magick::InitializeMagick(path.string().c_str());
|
||||
}
|
||||
|
||||
void
|
||||
deinit()
|
||||
{
|
||||
MagickCore::MagickCoreTerminus();
|
||||
}
|
||||
|
||||
static
|
||||
std::string
|
||||
formatToMagick(Format format)
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace CoverArt
|
||||
{
|
||||
|
||||
void init(const std::filesystem::path& path);
|
||||
void deinit();
|
||||
|
||||
class Image
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user