Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3942810
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:42:26+00:00 2026-05-20T00:42:26+00:00

I am using ImageMagick’s convert tool to convert images from within my Java program

  • 0

I am using ImageMagick’s convert tool to convert images from within my Java program running on Mac OS X.
I am using the following code, which I adapted from here.

public static void convertToJPG(String originalFile, String newFile) throws Exception {
    executeCommand("/usr/local/ImageMagick-6.6.7/bin/convert", originalFile, newFile);
}

private static void executeCommand(String... command) throws Exception {
    ProcessBuilder pb = new ProcessBuilder(command);
    pb.redirectErrorStream(true);
    Process p = pb.start();
    int exitStatus = p.waitFor();
    System.out.println(exitStatus);
    if(exitStatus != 0)
        throw new Exception("Error converting image.");
}

However, when I do this, I get an exit status of 133 and the error message below. I am assuming that this has something to do with permissions, as when I run the same command from the terminal, it works fine.

Error message:

dyld: Library not loaded: /ImageMagick-6.6.7/lib/libMagickCore.4.dylib
  Referenced from: /usr/local/ImageMagick-6.6.7/bin/convert
  Reason: image not found

Edit: Ok, so it turns out that I was getting the above error message due to Java not being able to see the DYLD_LIBRARY_PATH environment variable. So I restarted Eclipse and everything worked.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:42:27+00:00Added an answer on May 20, 2026 at 12:42 am

    While I wasn’t able to find anything about a 133 return code, I did notice that you aren’t reading the command standard out / standard error stream. I’d suggest reading that to see if ImageMagick is giving you some more helpful output. There’s a question here that deals with more complex use cases of the Runtime.exec() method, but the best basic way to do it is with this method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created an application using Imagemagick library with Qt on Mac. Now that I
I'm using ImageMagick to convert a pdf file to a png (thumbnail) image, and
Most probably using ImageMagick - how to turn photo into "cartoon"? Here's what I
I am using ImageMagick to programmatically reduce the size of a PNG image by
I am using imagemagick DLL (Refer: http://www.imagemagick.org ) for the resize image, But when
Im having a hard time converting cdr files to jpgs for previews using c#.net.
I want to capture a screenshot of an application's window from a Python script
Given a user uploaded image, I need to create various thumbnails of it for
Given an photograph uploaded by a user, what is best approach to creating a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.