Giter Site home page Giter Site logo

Comments (5)

collectiveaccess avatar collectiveaccess commented on July 28, 2024

You can try, but keep in mind that the return codes vary widely from platform to platform (and even between versions)

from providence.

miceno avatar miceno commented on July 28, 2024

Thank you!

I appreciate your comment!

The point is that as of now, an error is difficult to trace, for instance, if there is an error generating one of the tilepics of a big image, there is no log of it, and the result is a quiet and silent crash, with no clear traces on the log.

Anyway ,versions are already a problem if output is not normalized. As far as I had a look, most of the output from ImageMagick and GraphicMagick is normalized, but I didn't have a look at the others. For example, current mediainfo version is 19 but CA has version 0.7.82 on the vagrant machine.

Here it is a trace of running the new code with partially debug on exec (I have to manually change all of them :( ):

2020-03-26 21:22:07 - DEBUG --> Executing command: '/usr/bin/gm 2> /dev/null'
2020-03-26 21:22:07 - DEBUG --> Executing command: '/usr/bin/gm 2> /dev/null'
2020-03-26 21:22:07 - DEBUG --> Executing command: '/usr/bin/gm identify -format "%m;" '/var/www/html/media/collectiveaccess/images/0/10632_ca_object_representation_multifiles_media_10_original.jpg[0]' 2> /dev/null'
2020-03-26 21:22:07 - DEBUG --> Executing command: '/usr/bin/gm 2> /dev/null'
2020-03-26 21:22:07 - DEBUG --> Executing command: '/usr/bin/gm identify -format "%m;%w;%h;%q;%x;%y\n" '/var/www/html/media/collectiveaccess/images/0/10632_ca_object_representation_multifiles_media_10_original.jpg' 2> /dev/null'
2020-03-26 21:22:08 - DEBUG --> Executing command: '/usr/bin/gm convert '/var/www/html/media/collectiveaccess/images/0/10632_ca_object_representation_multifiles_media_10_original.jpg' '/tmp/gmiptcs4sYtl.iptc' 2> /dev/null'
2020-03-26 21:22:08 - DEBUG --> Executing command: '/usr/bin/gm identify -format '%[DPX:*]' '/var/www/html/media/collectiveaccess/images/0/10632_ca_object_representation_multifiles_media_10_original.jpg' 2> /dev/null'
2020-03-26 21:22:14 - DEBUG --> Executing command: '/usr/bin/gm 2> /dev/null'
2020-03-26 21:22:14 - DEBUG --> Executing command: '/usr/bin/gm 2> /dev/null'
2020-03-26 21:22:14 - DEBUG --> Executing command: '/usr/bin/gm identify -format "%m;" '/var/www/html/media/collectiveaccess/images/0/96387_ca_object_representation_multifiles_media_11_original.jpg[0]' 2> /dev/null'
2020-03-26 21:22:14 - DEBUG --> Executing command: '/usr/bin/gm 2> /dev/null'
2020-03-26 21:22:14 - DEBUG --> Executing command: '/usr/bin/gm identify -format "%m;%w;%h;%q;%x;%y\n" '/var/www/html/media/collectiveaccess/images/0/96387_ca_object_representation_multifiles_media_11_original.jpg' 2> /dev/null'
2020-03-26 21:22:14 - DEBUG --> Executing command: '/usr/bin/gm convert '/var/www/html/media/collectiveaccess/images/0/96387_ca_object_representation_multifiles_media_11_original.jpg' '/tmp/gmiptcWRwOsB.iptc' 2> /dev/null'
2020-03-26 21:22:14 - DEBUG --> Executing command: '/usr/bin/gm identify -format '%[DPX:*]' '/var/www/html/media/collectiveaccess/images/0/96387_ca_object_representation_multifiles_media_11_original.jpg' 2> /dev/null'
2020-03-26 21:22:16 - DEBUG --> Executing command: '/usr/bin/gm 2> /dev/null'
2020-03-26 21:22:16 - DEBUG --> Executing command: '/usr/bin/gm 2> /dev/null'
2020-03-26 21:22:16 - DEBUG --> Executing command: '/usr/bin/gm identify -format "%m;" '/var/www/html/media/collectiveaccess/images/0/47469_ca_object_representation_multifiles_media_12_original.jpg[0]' 2> /dev/null'
2020-03-26 21:22:16 - DEBUG --> Executing command: '/usr/bin/gm 2> /dev/null'
2020-03-26 21:22:16 - DEBUG --> Executing command: '/usr/bin/gm identify -format "%m;%w;%h;%q;%x;%y\n" '/var/www/html/media/collectiveaccess/images/0/47469_ca_object_representation_multifiles_media_12_original.jpg' 2> /dev/null'
2020-03-26 21:22:16 - DEBUG --> Executing command: '/usr/bin/gm convert '/var/www/html/media/collectiveaccess/images/0/47469_ca_object_representation_multifiles_media_12_original.jpg' '/tmp/gmiptcV7cXgA.iptc' 2> /dev/null'
2020-03-26 21:22:16 - DEBUG --> Executing command: '/usr/bin/gm identify -format '%[DPX:*]' '/var/www/html/media/collectiveaccess/images/0/47469_ca_object_representation_multifiles_media_12_original.jpg' 2> /dev/null'

With this log, it is trivial to know if the problem is the permissions of the folder, on the command or any other issue.

I think the key point is adding testing for the current supported versions and update the code or refactor as far as new versions appear that break the compatibility.

I am maintaining a web site with another PHP open source (Gallery2) and they did a pretty job for making it compatible with different versions of ImageMagick. The code becomes more complex.

I think the code for the media plugins requires some refactor, to avoid duplicating calls to some functions (identify 2>/dev/null is called 2-3 times for some requests), but it will be another PR 👍 😄

I have almost finished the code, I will upload it as a PR so you can provide advice, and then we decide.

from providence.

collectiveaccess avatar collectiveaccess commented on July 28, 2024

A refactor to eliminate duplicate calls would be good, and we're all for additional logging. Anything you can contribute is welcome.

In general the exec() plugins haven't been touched in a very long time. We use gmagick + GraphicsMagick for all of our installs. Performance-wise it is > 10x faster than the exec()-based options, and ~6x faster than imagick.

Keeping things compatible with shifting command-line options is not a huge priority for us, but if you can help we'll put it on our radar.

from providence.

miceno avatar miceno commented on July 28, 2024

The point is that I am planning to run on shared hosting with no GraphicMagick nor Gmagick nor Imagick support, only exec Imagemagick.

I am trying to get GraphicMagick to run, but I had some issues that were difficult to debug because I didn't have logging, so I started this refactor.

from providence.

collectiveaccess avatar collectiveaccess commented on July 28, 2024

I totally understand why you need to go this route, I'm just saying it's slower :-)

Thanks again for doing this work. It's very very useful.

from providence.

Related Issues (20)

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.