Skip to content

Commit

Permalink
www/fgallery: Migrate to oxipng
Browse files Browse the repository at this point in the history
Replace pngcrush with oxipng as pngcrush no longer compiles and will be
removed.

Also switch to ImageMagick 7

PR:		277761
  • Loading branch information
Daniel Engberg authored and ehaupt committed Mar 20, 2024
1 parent 8c47168 commit 1f350d8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
13 changes: 9 additions & 4 deletions www/fgallery/Makefile
@@ -1,6 +1,6 @@
PORTNAME= fgallery
PORTVERSION= 1.9.1
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= www graphics

MAINTAINER= ehaupt@FreeBSD.org
Expand All @@ -15,29 +15,34 @@ RUN_DEPENDS= exiftool:graphics/p5-Image-ExifTool \
exiftran:graphics/exiftran \
p5-Cpanel-JSON-XS>=0:converters/p5-Cpanel-JSON-XS

USES= magick:6,run
USES= magick:7,run
USE_GITHUB= yes
GH_ACCOUNT= wavexx
GH_TAGNAME= 45a8629

NO_ARCH= yes
NO_BUILD= yes

OPTIONS_DEFINE= 7ZIP FACEDETECT JPEGOPTIM
OPTIONS_DEFAULT= 7ZIP FACEDETECT JPEGOPTIM
OPTIONS_DEFINE= 7ZIP FACEDETECT JPEGOPTIM OXIPNG
OPTIONS_DEFAULT= 7ZIP FACEDETECT JPEGOPTIM OXIPNG

7ZIP_DESC= Use 7-Zip for better zip compression
FACEDETECT_DESC= Face detection for improved thumbnail centering
JPEGOPTIM_DESC= Use jpegoptim for JPEG size optimization
OXIPNG_DESC= Use oxipng for PNG size optimization

7ZIP_RUN_DEPENDS= 7zz:archivers/7-zip
7ZIP_RUN_DEPENDS_OFF= zip:archivers/zip
FACEDETECT_RUN_DEPENDS= facedetect:graphics/facedetect
JPEGOPTIM_RUN_DEPENDS= jpegoptim:graphics/jpegoptim
OXIPNG_RUN_DEPENDS= oxipng:graphics/oxipng

post-patch-7ZIP-on:
@${REINPLACE_CMD} -e 's|7za|7zz|g' ${WRKSRC}/${PORTNAME}

post-patch-OXIPNG-on:
@${REINPLACE_CMD} -e 's|pngcrush|oxipng|g' ${WRKSRC}/${PORTNAME} ${WRKSRC}/${PORTNAME}.1

do-install:
.for d in album view
(cd ${WRKSRC} && \
Expand Down
11 changes: 11 additions & 0 deletions www/fgallery/files/patch-fgallery
@@ -0,0 +1,11 @@
--- fgallery.orig 2024-03-17 13:48:32 UTC
+++ fgallery
@@ -649,7 +649,7 @@ sub process_img
sys('jpegoptim', '-q', $fout);
} elsif($pngoptim && $props{FileType} eq "PNG")
{
- sys('pngcrush', '-q', $fout, $ftmp);
+ sys('pngcrush', '-q --out', $ftmp, $fout);
rename($ftmp, $fout);
}

0 comments on commit 1f350d8

Please sign in to comment.