Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: Re: Bash script with Image Magick to a Java program Date: Fri, 27 May 2016 13:31:05 +0200 Organization: Decebal Computing Lines: 59 Message-ID: <871t4n4u12.fsf@Equus.decebal.nl> References: <87oa7s4f1u.fsf@Equus.decebal.nl> <8760tz50qf.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="12baf5125b19322b899c79c2e3878015"; logging-data="26797"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UGzSW8eQ3PJaIYv3z4PMnW3RaxNkdgsw=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Homepage: http://www.decebal.nl/ Cancel-Lock: sha1:1zU0TnrirhlX3cPv5umoK/Il7Q0= sha1:Z4+0rU03UiCNjhcOTn9NktTNDvg= Xref: csiph.com comp.lang.java.programmer:34400 On Friday 27 May 2016 12:00 CEST, Martin Gregorie wrote: > On Fri, 27 May 2016 11:06:16 +0200, Cecil Westerhof wrote: > >> I evaluate things. Maybe I start with the standard library and as >> my program evolves I switch. At the moment I know nothing about >> graphical functionality in Java. >> > Whether the standard image classes in java.awt.image will do the job > for you depends on the image source. I use it to produce thumbnails > of JPG images but find that it can't correctly handle some JPGs from > some sources. These are always B&W images, which result in a > thumbnail of the correct requested size but distorted by being > broken into vertical stripes separated by white 'bars' and, > typically with the right-hand 1/3 or so of the original image not > appearing in the thumbnail version. Well, I only work with color JPG files. ;-) > This seems to be a deficiency in the Java library since the GIMP > image manipulation program doesn't show this problem. I haven't > tried Image Magik on these images so don't know what it would do. > > Starting with the standard class library and only moving on if you > find things it can't do sounds like a good plot. > > My only other comment is that the documentation for the standard > image library does rather assume that you are already up to speed on > image manipulation and so you know what affine transforms, etc. are > and why you should use each type of operation on an image and in > what order. This isn't covered in the Java tutorials and there are > no references to this sort of basic information. I am not knowledged in image manipulation. So that could make things trickier. At the moment I do two things: - resize to a minimum format - resize to a precise format If the format is 852x316 and the input format is 4000x2664. The first results in an image with format 852x567 and the second in an in image with format 852x316 where the converted undisturbed image is centred on a black background 0f 852x316. This gives horizontal or vertical stripes. Is this doable (without jumping through hoops)? Otherwise I probably should go for im4java. Would it be easy to know if Image Magick is installed? I could then disable the advanced functions on systems that do not have Image Magick installed. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof