Comments (5)
You can try, but keep in mind that the return codes vary widely from platform to platform (and even between versions)
from providence.
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.
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.
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.
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)
- Display Templates showing on Summary Pages even when not enabled for this view HOT 2
- Duplicate items being saved into sets HOT 1
- Collection hierarchies on the Summary Screen: typo and clarification of value for settings
- Default Collection Search Creator Column is Broken
- PHP8 HOT 1
- "Image is being processed" after data import with background processing enabled HOT 7
- Current_contents missing policy and template HOT 1
- purge-deleted Only Deletes Some Records and Not Others HOT 7
- ExistingRecordPolicy in Data Import not functioning as expected (develop) HOT 2
- "null" Date Duplicates "Not Set" Date
- After editing Obj Rep Relationships, Object May Have No Primary
- URL Encoding Failure for Tags Search
- Duplicate entities showing in browse but search or within MySQL
- PHP fatal error on Develop branch HOT 5
- Prepopulate on branch develop 1.8 HOT 8
- Logo does not hyperlink back to home page when clicked HOT 2
- 'ERROR--> ApplicationException: Action is not defined' when accessing Media Submissions in Menu HOT 1
- NOJIRA : dont_use_natural_sort and idno_sort HOT 1
- Layered metadata element containers not obeying ''ifdef' display templating HOT 7
- Typo in dacs_heritage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from providence.