Imagemagick setup - image-processing

my employers have a requirement to upload very large hi-res images. Ordinarily uploading such images does not work.
I was told using ImageMagick would help shift the image processing burden to the Linux server instead of php (so I don't have to set the php max_memory to some ridiculous level).
Anyway, I followed this tutorial: http://thewichitacomputerguy.com/blog/how-enable-install-imagemagick-drupal
I got the following response:
* warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/bin/convert) is not within the allowed path(s): (/var/www/vhosts/mysite.co.uk/httpdocs:/tmp) in /var/www/vhosts/mysite.co.uk/httpdocs/includes/image.imagemagick.inc on line 55.
* No file /usr/bin/convert could be found. PHP's open_basedir security restriction is set to /var/www/vhosts/mysite.co.uk/httpdocs:/tmp, which may be interfering with the attempts to locate ImageMagick.
I have determined the /usr/bin/convert file definitely exists on the server but I am at a loss regarding how to proceed.
Can you guys help a drupaler out?

If you're on shared hosting, you will need to speak with your provider. If you administer your server, you will need to edit your php.ini to allow open_basedir access to your imagemagick directory.

ImageMagik always give me a hard time...
That tutorial you cited isn't the way that I typically go about installing it. I think that installing ImageMagik to your /includes folder could be related to the problem. If you want to continue to try to make that work, then try configuring ImageMagik in the Drupal admin pages to look in the right place:
admin/settings/imageapi/config
(assuming you've got the ImageAPI module)
If you can't make the magik happen in there.. I'd try installing ImageMagik with SSH (assuming you've got shell access, because this is a dedicated server)
To do that get yourself Putty
Then figure out what distro of linux you are running (check your host's forum, or ask them.. or try this) and run a command like this:
apt-get install imagemagick
or like this..
yum install imagemagik
Once you get it you'll just need to test it and set up the Drupal image handling with ImageCache
A few cool related modules (once you get it working):
ImageField focus
Avatar crop

Related

After Upgrading from Alfresco 4.2 to 5.2, Transformation is not working for .TIF Image files

I have migrated one Application from Alfresco 4.2 version to Alfresco 5.2 version.
But after up-gradation Image preview is not displaying for any file and Transformation is not working.
Console Logs:-----
2018-02-02 08:58:46,022 INFO [repo.jscript.ScriptNode] [http-apr-8080-exec-25] Unable to create thumbnail 'doclib' for image/tiff as no transformer is currently available.
2018-02-02 08:59:10,076 WARN [jcms.transform.TesseractOCRTransformer] [http-apr-8080-exec-45] Command options did not appear to contain ImageMagick setting for monochrome, cannot invoke Tesseract.
Can anyone please help with this, or any work around to solve this issue.
your valuable reply will be really appreciated.
For more details about issue, please find attached screen-shot.
In the Alfresco Community 5.2 on Windows the ImageMagick install is borked. I found a workaround:
Install ImageMagick from the developer site
https://www.imagemagick.org/script/download.php
Edit the alfresco-global.properties found in C:\alfresco-community\tomcat\shared\classes
Change the img.root value to point to your fresh installation, like this:
img.root=C:\\PROGRA~1\\ImageMagick-7.0.7-Q16
Restart the alfresco server
NOTE: You will see this in the logs before:
err: convert.exe: RegistryKeyLookupFailed `CoderModulesPath' # error/module.c/GetMagickModulePath/670.
convert.exe: no decode delegate for this image format `GIF' # error/constitute.c/ReadImage/509.
Afterwards that error will not be present in the logs.
There's a setenv.bat file that sets up some Imagemagick related environment variables. I suspect they're missing from the build that you have, either by yours or Alfresco's mistake.
After you installed Imagemagick separately, that installation simply took care of these variables.
They go something like this:
MAGICK_HOME="/srv/alfresco-3.4.a/common"
MAGICK_CONFIGURE_PATH="/srv/alfresco-3.4.a/common/lib/ImageMagick-6.5.1/config:/srv/alfresco-3.4.a/common/share/ImageMagick-6.5.1/config"
MAGICK_CODER_MODULE_PATH="/srv/alfresco-3.4.a/common/lib/ImageMagick-6.5.1/modules-Q16/coders"

Can not upload image to Spree app

I try to upload a product image to my Spree app, but i get this error
5errors prohibited this record from being saved:
Attachment Paperclip returned errors for file 'index.jpg' - check ImageMagick installation or image source file.
Attachment Paperclip::Errors::NotIdentifiedByImageMagickError
Attachment Paperclip::Errors::NotIdentifiedByImageMagickError
Attachment Paperclip::Errors::NotIdentifiedByImageMagickError
Attachment Paperclip::Errors::NotIdentifiedByImageMagickError
Should i install a gem, relocate my src image? Whats the problem here
You should to install ImageMagick. Follow these steps for install on Windows:
Download ImageMagick (you need to choose static version for your 32/64 bit OS)
Checked Add application directory to your system path and install
Reopen your command prompt to reload your PATH variables
Run convert -v to check the install worked
Okay so the problem is pretty complicated and after trying to solve it for about 3 hours i finally got it.
First, you have to remove the convert.exe from your System32 files.
We do this, because the Spree app relies on legacy code and when it
tries to upload the image the default convert.exe starts, we don't
want that.
Second you download and install the dynamic installation from the imagemagick site and you have to be sure to check the legacy support so the convert command gets supported.
I dont know if you have to, but i installed the paperclip gem. You may have to do that for it to work.
The whole reason this bug happens, is because Windows. So if you are new to this party, dual boot your station or swap to Ubuntu/Mac whatever. Seriously though, when the app tries to upload it uses the convert command, but convert is already a default Windows command so you can't upload the picture properly. So we disable the command and then we replace it with our imagemagick installation. That's it.Also good luck trying to delete the convert.exe from system32, its a weird process, but you can solve it with some google-fu.
Thanks to Michael for pointing me to right way.

How to install ImageMagick on Windows 8?

I'm trying to setup ImageMagick so I can use the Paperclip gem for Ruby on Rails. I've looked at pretty much every question on StackOverflow about the issue, but they all just skip over my issue, that none of the ImageMagick commands are recognized on the CommandPrompt.
I downloaded and then installed ImageMagick-7.0.1-1-Q16-x64-dll.exe on this page
I installed the program to my C: directory, so that there wouldn't be an issue with spaces in the Path, and I used all default installation selections and even selected "Install development headers" which some answers said to do. My issue is that when ImageMagick finishes installing, and it says to test some commands (like "convert -version) on Command Prompt, they all result in
"'convert' is not recognized as an internal or external command ...."
On the command prompt. What could be an issue? Every step-by-step tutorial automatically assumes that these commands are recognized. Most troubleshooting involves steps afterwards.
Here's the documentation for paperclip. All I have to do is make sure the gem has access to ImageMagick, by putting in the development.rb file:
Paperclip.options[:command_path] = "/usr/local/bin/"
In order to find that path above, however, the documentation says to type "which convert". I've researched this and apparently that's a Unix command, and not something for Windows.
So basically, what steps do I need to take so that paperclip has access to ImageMagick? Why aren't basic ImageMagick commands recognized, even after a completed installation?
When you install ImageMagick under Windows, they is a button you need to check that tells the script to install "legacy" utilities such as convert. Reinstall, click on this button, and convert is ready to use. Alternatively, install ImageMagick 6.X which deploys convert automatically.
Windows users, I've answered most of this here.
The windows command line won't run which convert. You'll need to use something like git bash.
Reinstalling image magick won't hurt. You could try another file. I know the dll one (you mentioned) is top of the list, the next one is 64bit as well. You must check every option at install as paperclip will use lots of image magick functionality behind the scenes so check all options. Then restart the system.
in command before typing convert you have to type in magick then convert
keep in mind you are using a newer version of IM hence you have to start by typing 'magick' and then follow other command

ImageMagick is installed, but php extension of Imagick is not enabled

Hy there,
I have a shared hosting account. They installed Image Magick on my request. But I get this error.
PHP Fatal error: Class 'Imagick' not found in /home/hamrohos/public_html/test.php on line 6
I told them what was wrong. They replied
ImageMagick is installed, but php extension of Imagick is not enabled on shared accounts
Now my question is Can I use Image magick or its any features if its php extensions are not enabled?
Currently I am using GD library but it doesnot have all features of image magick.
I have following features disabled too.
phpinfo(), exec(), system(), passthru()
Without enabling ImageMagick extension in PHP, you won't be able to use the functions it providesdirectly.
The only way to use ImageMagick in this scenario would be to call it with a system function and execute everything as a shell script. You would have to save the image data on disk to do this and after processing them with imagemagick, you would have to load them again.
Thus, It would definitely be feasible, but with severe overhead and changes to your scripts.

Need help configuring ImageMagick

I've directly downloaded the tar file from here onto my desktop for Mac OSX (which is what I'm using) and extracted its contents. Now I've read the following instructions on how to set it up, but honestly they're a bit too cryptic for me. I was wondering if anyone could please break down these instructions into simpler, bite size pieces for someone who typically has trouble configuring new things...
I'd truly appreciate any help! Thanks!
Btw, my end goal is to set this up for the Paperclip plugin.
The first step would be to install MacPorts if you don't have it already. Once MacPorts is installed it should be fairly straightforward based on the instructions listed at the link you provided.
sudo port install ImageMagick
For others interested in this topic, I might look into installing homebrew instead of MacPorts.

Resources