major-mayer / imageconverter

A simple Nextcloud app to convert HEIC/ HEIF images to JPEG
GNU Affero General Public License v3.0
21 stars 2 forks source link

Could not save the new converted image, because the content is empty. Something went wrong with the conversion before! #12

Closed familywww closed 5 months ago

familywww commented 10 months ago

PHP8.1 nextcloud: 27.1.1

$ php -m
[PHP Modules]
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
igbinary
imagick
intl
json
libsmbclient
libxml
mbstring
memcache
mysqli
mysqlnd
openssl
pcntl
pcre
pdlib
PDO
pdo_mysql
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
smbclient
snmp
soap
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
$ identify --version
Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib

log: [index] error: Exception: Could not save the new converted image, because the content is empty. Something went wrong with the conversion before! at <>

  1. /opt/nextcloud/app/apps/imageconverter/lib/Controller/ConvertController.php line 59 OCA\ImageConverter\Storage\ConvertStorage->saveNewImage()
  2. /opt/nextcloud/app/lib/private/AppFramework/Http/Dispatcher.php line 230 OCA\ImageConverter\Controller\ConvertController->convertImage()
  3. /opt/nextcloud/app/lib/private/AppFramework/Http/Dispatcher.php line 137 OC\AppFramework\Http\Dispatcher->executeController()
  4. /opt/nextcloud/app/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch()
  5. /opt/nextcloud/app/lib/private/Route/Router.php line 315 OC\AppFramework\App::main()
  6. /opt/nextcloud/app/lib/base.php line 1068 OC\Route\Router->match()
  7. /opt/nextcloud/app/index.php line 36 OC::handleRequest()
familywww commented 10 months ago

The reason for the error is due to a version conflict in libjpge. I couldn't find the duplicate libjpge. so.9 and couldn't eliminate this error. This issue was resolved by modifying the conversion object type to “png” in ConvertController.php

error log: PHP Fatal error: Uncaught ImagickException: Wrong JPEG library version: library is 90, caller expects 80

major-mayer commented 10 months ago

Hey, sorry for my slow response. That's interesting, but it sounds more like a setup error to me, as my app doesn't manage how ImageMagick is installed. I checked on my docker container where I installed PHP Imagick using docker-php-ext-install and libjpeg was located in /lib/x86_64-linux-gnu. But good that you found a workaround for your specific use case. Be aware that PNG is a lossless file format, so the file size will most likely drastically increase.

Can we close this issue then?

major-mayer commented 5 months ago

Closing this due to inactivity