Monday, August 08, 2011

Batch Resize on Linux

Install imagemagick.
Now you can use mogrify.
Example: to resize to half the original size all the JPGs in a directory (keeping the aspect ratio of course):

> mogrify -resize 50% *.jpg

More here.

Eclipse Startup - Crash on Fedora 15

For some obscure reason, the Fedora 15-packaged Eclipse doesn't include JSP syntax highlighting and I could find no easy way to add it (conflicting dependencies prevent that). So I resorted to the original TAR-GZ distribution. The problem there is with the OpenJDK. My Eclipse simply crashes on startup.
What you need to do is tell Eclipse to use Sun's JDK.
Open the eclipse.ini and add the path to the Java executable:

-vm
/opt/java/jdk1.6.0/bin/java

right before the -vmargs option.
More here.

[UPDATE] - Oh, the reason for the crash is not openJDK. It's a bug in Fedora. To circumvent it do the following:
  1. In Gnome3 the webkit library name changed to libwebkitgtk so you need to create one missing symbolic link: ln -s /usr/lib/libwebkitgtk-1.0.so.0 /usr/lib/libwebkit-1.0.so.2
  2. Add -Dorg.eclipse.swt.browser.UseWebKitGTK=true to the -vmargs options in eclipse.ini
More here.