Giter Club home page Giter Club logo

imageconverter's Introduction

Usage

Just right click your .heif/ .heic image and select "Convert this image to JPEG". It converts it to a jpeg file using the same location.

Requirements

Needs the PHP Imagick extension to be installed on your host compiled with support for the HEIC/ HEIF format. Check if your PHP installation supports the HEIC format by entering "php -i" in the terminal and go to the Imagick section.

Here you can find a good tutorial about how to compile Imagemagick with HEIC support and install the PHP extension.

The official Docker Nextcloud image already includes the Imagick extension with support for the HEIC format.

ToDos

  • Testing
  • Option to choose JPEG quality
  • Option to convert to other formats than JPEG
  • ...

imageconverter's People

Contributors

major-mayer avatar mwlaurenz avatar steasenburger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

imageconverter's Issues

Error when trying to convert HEIC to JPG

I have a nextcloud installed as linuxserver/nextcloud docker.
This docker already meet your requirements: HEIC support installed and the PHP bindings (Imagick extension) enabled,

In Nextcloud, when clicking on heic and trying to convert it i'm getting message: Error An Error occured!

Version of nextcloud: 18.0.6

v2.0.0 can not be enabled

After updating to v2.0.0 and when trying to enable the app, I get
grafik

[PHP] Fehler: Class OCA\ImageConverter\AppInfo\Application contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (OCP\AppFramework\Bootstrap\IBootstrap::boot) at /var/www/nextcloud/apps/imageconverter/lib/AppInfo/Application.php#17
	POST /index.phpapps/enable
	von xxx.xxx.xxx.xxx von username um 05.04.2024, 20:52:09

This is logged every time clicking "Activate". Outcome with occ command not tested, likely the same :-(

An Erorr Occured when convert a picture

when I convert a heic to jpeg,It report An Erorr Occured!

the log is as below:

Exception: Too few arguments to function OC\Files\Storage\Wrapper\Wrapper::file_put_contents(), 1 passed in /var/www/nextcloud/lib/private/Files/View.php on line 1161 and exactly 2 expected
/var/www/nextcloud/lib/private/AppFramework/App.php - line 152:

OC\AppFramework\Http\Dispatcher->dispatch(OCA\ImageCon ... {}, "convertImage")

/var/www/nextcloud/lib/private/Route/Router.php - line 308:

OC\AppFramework\App::main("OCA\ImageC ... r", "convertImage", OC\AppFramew ... {}, { action: nu ... "})

/var/www/nextcloud/lib/base.php - line 1009:

OC\Route\Router->match("/apps/imageconverter/convert")

/var/www/nextcloud/index.php - line 37:

OC::handleRequest()

The Reason is:ArgumentCountError: Too few arguments to function OC\Files\Storage\Wrapper\Wrapper::file_put_contents(), 1 passed in /var/www/nextcloud/lib/private/Files/View.php on line 1161 and exactly 2 expected
/var/www/nextcloud/lib/private/Files/View.php - line 1161:

OC\Files\Storage\Wrapper\Wrapper->file_put_contents("files/照片 20 ... g")

/var/www/nextcloud/lib/private/Files/View.php - line 696:

OC\Files\View->basicOperation("file_put_contents", "/liushui/fi ... g", [ "update","write"], null)

/var/www/nextcloud/lib/private/Files/Node/File.php - line 72:

OC\Files\View->file_put_contents("/liushui/fi ... g", null)

/var/www/nextcloud/apps/imageconverter/lib/Storage/ConvertStorage.php - line 62:

OC\Files\Node\File->putContent(null)

/var/www/nextcloud/apps/imageconverter/lib/Controller/ConvertController.php - line 59:

OCA\ImageConverter\Storage\ConvertStorage->saveNewImage(2244, "照片 20-03-01 21-41-38 0332.jpg", null)

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 169:

OCA\ImageConverter\Controller\ConvertController->convertImage("照片 20-03-01 ... c", 2244, 100)

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 100:

OC\AppFramework\Http\Dispatcher->executeController(OCA\ImageCon ... {}, "convertImage")

/var/www/nextcloud/lib/private/AppFramework/App.php - line 152:

OC\AppFramework\Http\Dispatcher->dispatch(OCA\ImageCon ... {}, "convertImage")

/var/www/nextcloud/lib/private/Route/Router.php - line 308:

OC\AppFramework\App::main("OCA\ImageC ... r", "convertImage", OC\AppFramew ... {}, { action: nu ... "})

/var/www/nextcloud/lib/base.php - line 1009:

OC\Route\Router->match("/apps/imageconverter/convert")

/var/www/nextcloud/index.php - line 37:

OC::handleRequest()_

Have any idea what should I do? Thx!

By the way,the Nextcloud cannot show the heic preview either,but my ImageMagick work works well when I tried to convert *.heic to *.jpeg in commond line.the php-imagick also installed but I don't know if it works well.

NC 28 Support

Please add Official Support for Nextcloud Version 28

Massive log spam

{"reqId":"X-LOoSrdRvqppRN6gPdNXAAAAFg","level":3,"time":"2021-01-04T08:15:29+00:00","remoteAddr":"37.247.74.58","user":"--","app":"PHP","method":"GET","url":"/index.php/apps/logreader/poll?lastReqId=X-LOoSrdRvqppRN6gPdNWwAAAEQ","message":{"Exception":"Error","Message":"include_once(): Failed opening '/var/www/vhosts/path/to.my.cloud/apps/imageconverter/lib/AppInfo/../../vendor/autoload.php' for inclusion (include_path='/var/www/vhosts/path/to.my.cloud/3rdparty/pear/archive_tar:/var/www/vhosts/path/to.my.cloud/3rdparty/pear/console_getopt:/var/www/vhosts/path/to.my.cloud/3rdparty/pear/pear-core-minimal/src:/var/www/vhosts/path/to.my.cloud/3rdparty/pear/pear_exception:/var/www/vhosts/path/to.my.cloud/apps') at /var/www/vhosts/path/to.my.cloud/apps/imageconverter/lib/AppInfo/Application.php#37","Code":0,"Trace":[{"file":"/var/www/vhosts/path/to.my.cloud/apps/imageconverter/lib/AppInfo/Application.php","line":37,"function":"onError","class":"OC\Log\ErrorHandler","type":"::"},{"file":"/var/www/vhosts/path/to.my.cloud/apps/imageconverter/lib/AppInfo/Application.php","line":37,"function":"include_once"},{"file":"/var/www/vhosts/path/to.my.cloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":117,"function":"register","class":"OCA\ImageConverter\AppInfo\Application","type":"->"},{"file":"/var/www/vhosts/path/to.my.cloud/lib/base.php","line":644,"function":"runRegistration","class":"OC\AppFramework\Bootstrap\Coordinator","type":"->"},{"file":"/var/www/vhosts/path/to.my.cloud/lib/base.php","line":1091,"function":"init","class":"OC","type":"::"},{"file":"/var/www/vhosts/path/to.my.cloud/index.php","line":35,"args":["/var/www/vhosts/path/to.my.cloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/vhosts/path/to.my.cloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.4.0","id":"5ff2cea174960"}

this error gets spammed every second since last update, even after removing and reinstalling the app

Ubuntu 20.04 on KVM with Plesk and PHP 7.4

Auto Convert

Would be nice to have the option or a occ command to automatic convert all heif/heic images to jpeg

Nextcloud 23.03 - cannot open images in HEIC Format

Actual behaviour

i can see/open all photos in HEIC Format, taken from iPhone 7, but all photos in HEIC Format, taken from iPhone XS, users are not able to view it.

Steps to reproduce

whenever i'm trying to open a *.heic photo from newer iPhones

Expected behaviour

users should be able to view the image

Client configuration details

--------------------------------

iPhone XS

Server configuration details

--------------------------------

Version: Intel(R) Xeon(R) E-2136 CPU @ 3.30GHz
Max Speed : 4300 MHz
Current Speed: 3300 MHz
Memory: 7.58GB

Operating System: Red Hat Enterprise Linux release 8.5 (Ootpa)

Webserver: Apache/2.4.37 (Red

Database: mysql 10.3.28-MariaDB,

PHP version: PHP Version => 7.4.26

Nextcloud: - version: 23.0.3.2

Updated from an older Nextcloud/ownCloud or fresh install:

Update from older nc

Where did you install Nextcloud from:

origin source

Signing status:

Login as admin user into your Nextcloud and access http://example.com/index.php/settings/integrity/failed
paste the results here.

No errors have been found.

NC 24 Support

Please add Official Support for Nextcloud Version 24

Do not show Option if file is not HEIF / HEIC

Is there a way you could modify this to only give an option to convert if the image selected is HEIC / HEIF format? Currently if I select any image format (JPEG, PNG, etc) the option to convert to JPEG is available. There is an error message if the file is not HEIC / HEIF.

If it were possible, I would rather the option not even show up to users if the file is not able to be converted, to avoid confusion.

Server error: 503 Service Unavailable

Server error: GET https://github.com/major-mayer/imageconverter/releases/download/v.1.3.2/imageconverter.tar.gz resulted in a 503 Service Unavailable response: <!-- Hello future GitHubber! I bet you're here to remove those nasty inline styles, DRY up these te (truncated...)

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

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()

Cant find autoload.php

Operating system: Linux 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l

Webserver: Apache (fpm-fcgi)

Database: mysql 10.3.31

PHP version: 7.3.31-1~deb10u1

Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, cgi-fcgi, mysqlnd, PDO, xml, bcmath, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, intl, json, ldap, exif, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache

Nextcloud version: 21.0.4 - 21.0.4.1

Hi,

i have massive log spaming because the system cant find the autoload.php:

Error | PHP | Error: include_once(): Failed opening '/var/www/nextcloud/apps/imageconverter/lib/AppInfo/../../vendor/autoload.php' for inclusion (include_path='/var/www/nextcloud/3rdparty/pear/archive_tar:/var/www/nextcloud/3rdparty/pear/console_getopt:/var/www/nextcloud/3rdparty/pear/pear-core-minimal/src:/var/www/nextcloud/3rdparty/pear/pear_exception:/var/www/nextcloud/apps') at /var/www/nextcloud/apps/imageconverter/lib/AppInfo/Application.php#37/var/www/nextcloud/apps/imageconverter/lib/AppInfo/Application.php - line 37:OC\Log\ErrorHandler::onError(2, "include_onc ... )", "/var/www/ne ... p", 37, { context: c ... }})/var/www/nextcloud/apps/imageconverter/lib/AppInfo/Application.php - line 37:include_once()/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php - line 125:OCA\ImageConverter\AppInfo\Application->register(class@anonym ... {})/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php - line 82:OC\AppFramework\Bootstrap\Coordinator->registerApps([ "files","a ... "])/var/www/nextcloud/lib/base.php - line 634:OC\AppFramework\Bootstrap\Coordinator->runInitialRegistration()/var/www/nextcloud/lib/base.php - line 1076:OC::init()/var/www/nextcloud/ocs/v1.php - line 32:require_once("/var/www/ne ... p")/var/www/nextcloud/ocs/v2.php - line 24:require_once("/var/www/nextcloud/ocs/v1.php")
-- | -- | --

Is there a way to fix? My HEIC files are even not previewed. I installed imagick as it is necessary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.