Omeka cannot find ImageMagick

Installed latest Omeka (service provider’s shared hosting services) and tried to set ImageMagick path as provided by service provider. For some reason Omeka cannot find it and testing fails (also uploading images as part of the archiving fails and I guess because Omeka cannot find IM…).

And seems that this is common problem but nothing fixed nor straightforwarded fixing instructions…

Omeka

Hello,

I believe you are using Omeka Classic, not Omeka S?

Unfortunately every server is different, but /usr/bin/ and /usr/local/bin are common enough answers.

You may not need the “/magick” bit - try just /usr/local/bin and see if that works.

Then, did you read the guide here on setting the thumbnailer using the local.config.php file? If you have SSH, FTP, CPanel/FileManager, etc. access to your server:

https://omeka.org/s/docs/user-manual/configuration/#thumbnails

Look to see if there is a value already in the imagemagick_dir and try it there.

It may be worth trying to set other thumbnailing services instead of ImageMagick, at least as a troubleshooting step.

Let me know if any of this works.

Hi Allana,

Thanks for the quick reply.

Shortening the path did not help.

First, Omeka was ready-to-install (via Installatron) in service provider’s servers and as we have been using omeka.net for half a year, started to look for the option move over to local server.

I just checked the version and Omeka tells this:

System
Omeka 3.0.2
PHP 7.4.29 (fpm-fcgi)
OS Linux 5.10.0-0.bpo.12-amd64 x86_64
MySQL Server 10.3.32
MySQL Client mysqlnd 7.4.29

PHP Extensions
Regular bcmath, calendar, cgi-fcgi, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, ionCube Loader, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, Reflection, session, SimpleXML, soap, sockets, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib
Zend the ionCube PHP Loader + ionCube24

there’s no local.config.php, at least visible one, in any of the available directory.

Sorry, forget to add that it is Omeka Classic, not S.

I found config.ini and removed semicolon from
fileDerivatives.strategy = "Omeka_File_Derivative_Strategy_Imagick”
=> no help, cannot find ImageMagick nor anything else

I put back semicolon and added as instructed by manual

fileDerivatives.strategy = "Omeka_File_Derivative_Strategy_GD”

As a result Omeka “stalled” as with any option, menu choice etc. I tried to use, it reported error and only way to solve it was to remove above line from config.ini (or comment it out…)…

My fault, I got myself confused between Classic and S in the process of writing that. I’m glad you found the right config.ini file.

I am in the process of editing some little issues out of the user manuals. This is a good example. Note that one of the quotes in those code snippets is a straight quote, and the other is curly. It is very hard to see, of course. I think copying text directly from the user manual may be the culprit, in this setting at least.

When I remove the semi-colon from the start of the line, and make sure the entry reads fileDerivatives.strategy = "Omeka_File_Derivative_Strategy_GD" with straight quotes, I do not break the site and the “ImageMagick Directory Path” field on the Settings page actually disappears, which is a good sign that it is working. Then I was able to upload a new file and watch it generate a thumbail.

No worries, Allana, I think I made mistakes not reporting things correctly.

We are getting somewhere, I just don’t know where yet:

I did what you did in your reply (using GD instead).

Directory Path field disappeared as you said.

First, I created “empty” item (=no files) and that worked fine and dandy.

Next I created an item with a file (5 MB) and I got error 500. Also, empty item was created (no textual data, that disappeared) but had file metadata (on the right column when clicking the item open). When clicking this item metadata, which is uploaded file name (in this case “ihmiset 7.jpg”).

When clicking that (as it is a link), Omeka opens that image but as there’s no built thumbnails, there’s just same file name which should point to uploaded original file. When clicking that I get error 404 ("/files/original/413504928bd802cc8be27ff2a562909f.jpg ei ole toimiva osoite") and seems that even the uploaded original file has not been saved.

So, not only thumbnails are not created but as it fails (or something else fails?), created item is not saved nor uploaded file is not saved.

If you got an error 500 while uploading the file then it just didn’t complete the process, so it’s not surprising that the file’s not uploaded properly to that item.

There are instructions in the manual for error message display that should turn that 500 error into something that prints a descriptive message, or you can check your server’s PHP logs. My bet would be that your error was that PHP ran out of memory: a 5 MB JPEG file would represent a pretty large image that could use lots of memory. One downside of using GD is that on some servers, the memory used when processing an image counts against PHP’s memory limit when you use GD.

You actually have the Imagick extension there listed from the version information you pasted (in “PHP Extensions”). You mentioned setting the “strategy” to Imagick as the example in the file showed: what happened then? Imagick is generally preferable to GD if you have support for it on your server.

Thanks jflatnes!

I have to say that I do not know how 5MB files are handled when uploading, or to be processed, but actually I do not consider that to be very large yet. But in any case, need to check from service provider, if there’s any limitations in terms of file size.

If removing comments for the Imagick “strategy”, or commenting all out (=using default “strategy”), test button in settings gives error that provided path is not correct. Tried all variations provided by service provider and even left field empty (which by the service provider should work too), with same results, path is wrong.

If I try to add an item with file, I’ll get error but for some reason an empty item is still created (all textual data typed has disappeared though) and in this case (default “strategy”) not even “failure” image data recorded (as with GD).

Gotta enable error logging but gotta wait until tomorrow as it is quite late here now, in Finland.

There’s no general problem with 5 MB files (as you say, they’re not very large) but it’s just a quirk of GD that even relatively small byte-size images can cause issues.

When you have this line set in the config.ini:

fileDerivatives.strategy = "Omeka_File_Derivative_Strategy_Imagick"

you shouldn’t have the ImageMagick path input and “Test” button visible in the settings screen.

You might want to just try an upload with that setup, if you haven’t yet.

Thanks again! Problem found and the most typical one: being between the screen and chair… me! :slight_smile:

At some point I made a mistake and instead of “…ImaGICK” and have typed “…ImageMagick”… I should really start learning to copy paste instead typing…

Now with right way written strategy it works! Thanks a lot, guys, for the good and fast help!