[Modify] jmagick installation (based on Windows), lite steps-add download address

Source: Internet
Author: User

[This article is transferred from the network and made some modifications based on actual operations]

Jmagick installation (based on Windows), lite steps:
1. Download jmagick-win-5.5.7-q8.zip and put jmagick. Jar under the application Lib. Copy jmagick. DLL to system32;

Http://downloads.jmagick.org/5.5.7/

2. Install imagemagick-5.5.7-q8-windows-dll.exe.

Http://sourceforge.net/project/showfiles.php? Group_id = 24099 & package_id = 47692

3. Restart the machine
Troublesome, but the ability to process images is indeed beyond imagination (however, JVM crach is frequently used in version 6.2.6, which is scary)

For jmagick, I only use image scaling.
CodeAs follows:

Code
Package Test;

ImportJava. AWT. dimension;

ImportMagick. imageinfo;
ImportMagick. magickexception;
ImportMagick. magickimage;

Public ClassJmagicktest {

/**
* @ Param ARGs
* @ Throws Magickexception
*/
Public   Static   Void Main (string [] ARGs) Throws Magickexception {
// Todo auto-generated method stub
System. setproperty ( " Jmagick. systemclassloader " , " No " ); // There's nothing to say about it. Just do it.
String fromfilename =   " C: \ 11.gif " ;
String tofilename =   " C: \ test.gif " ;
Int Towidth =   200 ;


Imageinfo info =   New Imageinfo (fromfilename );
Magickimage fromimage =   New Magickimage (Info );
Dimension dim = Fromimage. getdimension ();
Double W = Dim. getwidth ();
Double H = Dim. getheight ();
Int Toheight = ( Int ) (H * Towidth / W ); // Scale by width

Magickimage toimage = Fromimage. scaleimage (towidth, toheight ); // Scaling operation
Toimage. setfilename (tofilename ); // Set output file name
Toimage. writeimage (Info ); // Save

}

}


I found many problems with the latest version, either noclassdeffounderror or can't find dependent libraries.

Then downgrade to 5.5.7, which means that the idea of only the latest version of it is not necessarily correct.

Attached javadoc address:

Http://downloads.jmagick.org/jmagick-doc/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.