Want to subscribe to topics you're interested in?
Become a Member

Nextcloud3 HEIC previews

Discussion in 'Other Web Apps usage' started by Kintaro, Dec 4, 2022.

Tags:
  1. Kintaro

    Kintaro Member

    106
    11
    18
    Dec 2, 2016
    Italy
    Ratings:
    +30
    Local Time:
    4:11 AM
    1.15.x
    MariaDB 10
    Hello, I'm trying Nextcloud3 on centimod.


    I'm trying to make HEIC and MOV previews work.

    On Nextcloud forum they refer to this:
    5 minutes to Install Imagemagick with HEIC support on Ubuntu 20.04 (and 18.04) DigitalOcean

    Right now this is what I have on my system:

    Code:
    #convert --version
    Version: ImageMagick 6.9.12-67 Q16 x86_64 17519 https://legacy.imagemagick.org
    Copyright: (C) 1999 ImageMagick Studio LLC
    License: https://imagemagick.org/script/license.php
    Features: Cipher DPC Modules OpenMP(3.1)
    Delegates (built-in): bzlib cairo djvu fontconfig freetype gslib gvc heic jbig jng jp2 jpeg lcms ltdl lzma openexr pangocairo png ps raqm raw rsvg tiff webp wmf x xml zlib
    
    #php -r 'phpinfo();' | grep HEIC
    "empty"
    Need I to re-compile php imagemagick module and then re-install it?

    The sad thing is that HEIC and HVEC support is lacking on broswers. :-(
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,223
    12,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,654
    Local Time:
    12:11 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    What PHP version are you using? Centmin Mod uses REMI YUM repo's ImageMagick 6.9 out of the box and that doesn't have HEIC support out of the box unless you install an additional package. Centmin Mod does have an experimental option for adding HEIC support but hasn't been worked on in a while. Will have to revisit it for both CentOS 7 and EL8/9 it seems.
     
  3. eva2000

    eva2000 Administrator Staff Member

    53,223
    12,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,654
    Local Time:
    12:11 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah not much point then. But I had a look at my Centmin Mod code and tried adding support for compiling ImageMagick 7 with HEIC support and Imagick PHP extension support for HEIC and seems to work for install. Beyond that no testing has been done to guarantee it doesn't break anything yet.

    If you want to test this you can try on a test VPS non-production site with Centmin Mod 130.00beta01 installed.
    Set in persistent config file /etc/centminmod/custom_config.inc the variable
    Code (Text):
    IMAGEMAGICK_SOURCE_INSTALL='y'
    

    And then, patch the code with 5 commands, with the last command running centmin.sh menu option 15 which will install ImageMagick 7, libheif, x265 and libde265 dependencies and recompile Imagick PHP extension.
    Code (Text):
    # update to latest 130.00beta01
    cmupdate
    # switch to /usr/local/src/centminmod
    cmdir
    # download patch
    wget -O imagemagick7-heic.patch https://gist.github.com/centminmod/e5aa313fd8ac47745f03a9bc10109012/raw/imagemagick7-heic.patch
    # apply patch
    patch -p1 < imagemagick7-heic.patch
    # run centmin.sh menu option 15
    centmin
    

    Just run cmupdate as 130.00beta01 now as added this patch natively.
    Code (Text):
    convert --version
    Version: ImageMagick 7.1.0-20 Q16-HDRI x86_64 2022-01-22 https://imagemagick.org
    Copyright: (C) 1999-2021 ImageMagick Studio LLC
    License: https://imagemagick.org/script/license.php
    Features: Cipher DPC HDRI Modules OpenMP(4.5)
    Delegates (built-in): bzlib fontconfig freetype heic jbig jng jp2 jpeg lcms ltdl lzma openexr png tiff webp x xml zlib
    Compiler: gcc (11.2)
    

    with PHP 8.0.26 Imagick PHP extension
    Code (Text):
    php --ri imagick
    
    imagick
    
    imagick module => enabled
    imagick module version => @PACKAGE_VERSION@
    imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
    Imagick compiled with ImageMagick version => ImageMagick 7.1.0-20 Q16-HDRI x86_64 2022-01-22 https://imagemagick.org
    Imagick using ImageMagick library version => ImageMagick 7.1.0-20 Q16-HDRI x86_64 2022-01-22 https://imagemagick.org
    ImageMagick copyright => (C) 1999-2021 ImageMagick Studio LLC
    ImageMagick release date => 2022-01-22
    ImageMagick number of supported formats:  => 257
    ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, FTXT, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YAML, YCbCr, YCbCrA, YUV
    
    Directive => Local Value => Master Value
    imagick.locale_fix => 0 => 0
    imagick.skip_version_check => 0 => 0
    imagick.progress_monitor => 0 => 0
    imagick.set_single_thread => 1 => 1
    imagick.shutdown_sleep_count => 10 => 10
    imagick.allow_zero_dimension_images => 0 => 0
    
     
  4. Kintaro

    Kintaro Member

    106
    11
    18
    Dec 2, 2016
    Italy
    Ratings:
    +30
    Local Time:
    4:11 AM
    1.15.x
    MariaDB 10
    I chosen to switch back to h264 videos and jpeg photos on my iPhone7. To much trouble for a family nextcloud test instance.
     
  5. eva2000

    eva2000 Administrator Staff Member

    53,223
    12,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,654
    Local Time:
    12:11 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Indeed. FYI, I've added the above patch native to 130.00beta01 too now though.