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
Related
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"
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.
I am following Rails Tutorial. I am on section 3.7.1 and I am trying to get color in my gitbash command prompt when running bundle exec rake test. I have tried installing ansi, the win32console gem and the gem called turn and nothing seems to work.
Is it even possible to get red and green colors when running bundle exec rake test?
You definitely can get colored output to show up. But not with using the standard Windows cmd.exe or powershell. Gems won't help. You need to need add the ability to correctly interpret ANSI escape codes to your system -- something that cmd and powershell aren't able to do. (ANSI.sys was how ANSI escape codes were handled under DOS. cmd and powershell don't use it.)
You need to (1) install ANSICON and/or (2) install and use a different console/console emulator or shell that handles colors (ANSI escape codes).
(1) ANSICON is a program for Windows that interprets ANSI escape codes so that color is displayed. It kind of runs 'on top of' cmd or powershell. You can set it up so that it's always used whenever you use cmd or powershell, or use it only at specific times. Most people install this and are really happy with it.
Jason Karns wrote a blog post about installing and using ANSICON for git bash (on Windows) that folks have found helpful.
(2) Here are the popular options for alternatives to cmd/powershell. These are console emulators and tools and shell alternatives:
ConEmu - ("ConEmu-Maximus5") This is a console emulator, not a shell. You can use it with any shell (cmd, powershell, cygwin, bash, etc). But in day-to-day use, once you set it up, you use it just like you'd use cmd.exe or powershell, etc. (I use this so know more about it than the other choices. I have configurations for it to start up with different git/ruby version/rails version configurations as needed. I don't use ANSICON because I use ConEmu whenever I need to open up a console.)
Console 2 - Like ConEmu, this is a console emulator that adds functionality above and beyond cmd.exe (including displaying ANSI colors). You can use it with existing shells (e.g. powershell, etc.) Here's a SO answer that talks about using Console 2.
Console Z - a fork of Console 2 that is current and actively maintained. I haven't ever used it, but here is some info on how you'd configure Console Z to work with git bash.
You can also (or instead of) use a Unix-like shell (or suites):
Cygwin is the best known suite of Unix-like commands that runs in Windows. Comes with shells (e.g. MinTTY) that can be used and will work with ANSI codes
Babun A windows shell that sits on top of a cygwin install. Configurable; you can create configurations (e.g. for git bash or rvm or whatever) and share them as plug-ins. (Uses the mitty console.)
MinGW - A "Minimalist GNU for Windows" that has a GNU toolset for windows, focused on those tools needed for development. (IOW, it's a smaller and slightly different set than Cygwin provides.) DevKit, used to complie ruby gems into native windows code, uses MinGW.
MinSYS - "[A] contraction of "Minimal SYStem", is a Bourne Shell command line interpreter system. Offered as an alternative to Microsoft's cmd.exe, this provides a general purpose command line environment, which is particularly suited to use with MinGW, for porting of many Open Source applications to the MS-Windows platform; a light-weight fork of Cygwin-1.3, it includes a small selection of Unix tools, chosen to facilitate that objective." (From the MinGW site:)
Some searching might turn up additional options. These are the options most talked about and used (based on talking with others IRL, StackOverflow, and doing searching now and previously.)
Install and set one of those options (it won't take long), and then you'll be all set to see the helpful colors used by RSpec or git or whatever.
I've been searching for a way to install Image Magick on my Mountain Lion setup (where I use MAMP Pro). I did find this article, but it isn't specific to ML. Also found a couple other similar questions here on SO but they were too specific I think. Doesn't help that I'm not great at this sort of thing. Can anyone point me to a good resource?
As was pointed out in erwinheiser's comment, MAMP 3 now comes with imagemagick pre-installed. I checked MAMP's User Guide (PDF) and found this:
The ImageMagick PHP module is included by default, but you must enable it inside the php.ini template file. Remove the ‘;’ from the following line.
;extension=imagick.so
And how do you find and change the (right) php.ini file for MAMP Pro?
From MAMP's menu choose File › Edit Template › PHP › [the latest version]
or use the keyboard shortcut: ⌘4
Make the edit. (Imagick was was at line 542 in mine.)
Save and close the file.
MAMP asks if you want to restart the servers now, choose yes.
And you're done!
Make sure you check out Joel Farris' answer if you're using an up-to-date version of MAMP
I finally managed to get it installed properly using Homebrew and the instructions here: http://egoco.de/post/23167969231/installing-imagemagick-for-php-and-mamp
I did have to run brew doctor and brew link a couple of times to fix dependencies (and change permissions on a file or two), and use
brew install php54-imagick
rather than the one mentioned at the url.
The extension he mentions at the end (the bit you have to paste in your different ini files) is:
[imagick]
extension="/usr/local/Cellar/php54-imagick/3.1.0RC2/imagick.so"
Hope it helps!
MAMP comes with Imagick installed. I have MAMP v3.2.1 (not MAMP Pro) running on OS X 10.10.3 (Yosemite).
I enabled imagick by editing php.ini file which comes with MAMP.
php.ini file is available on the following path:
/Applications/MAMP/bin/php/php5.6.7/conf/php.ini
Replace 5.6.7 with your php version number.
php.ini file will contain the following line:
;extension=imagick.so
Change that line to:
extension=imagick.so
Now restart the MAMP servers and you are good to go.
We made a Mac installer package here— http://www.cactuslab.com/imagemagick/
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