Re: Work around requested
On 12/20/2011 3:46 PM, bH wrote:
On Dec 19, 12:01 am, bH<bherbs...@hotmail.com> wrote:
On Dec 18, 1:36 am, "John B. Matthews"<nos...@nospam.invalid> wrote:
In article
<17844998.127.1324178380897.JavaMail.geo-discussion-forums@pril5>,
Lew<lewbl...@gmail.com> wrote:
bH wrote:
I have jdk1.7.0, using a Windows7 machine.
I am working on a program
that will reduce a jpeg image to a
Thumbnail sized jpeg image. My program sample
uses these three imports,
among others. They are:
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
my IDE lists the error as
"package com.sun.image.codec.jepg does
not exist."
Is there a work around that will do the same thing
but without these import listed above?
TIA for your reply.
No.
We'll assume the misspelling in your post was a typo and that you did
not copy and paste the message.
Good point; exact, quoted error messages are also a good search target.
The existence or non-existence of a package does not depend on your
'import' directives.
You have not provided the correct classpath to the compiler for it to
detect the needed package.
I recently installed 1.7.0_02, and I can see them in either NetBeans or
the command line with the classpath option, e.g.:
javap -classpath "\Program Files\Java\jdk1.7.0_02\src.zip" com.sun.image.codec.jpeg.JPEGCodec
The bigger problem is that these classes may not be available in future
releases. You might want to look at removing the dependence. The
classes javax.imageio.ImageIO and java.awt.image.AffineTransformOp may
be all you need.
--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>- Hide quoted text -
- Show quoted text -
Hi All,
Thanks for your help and suggestions.
The workaround is now complete.
bH- Hide quoted text -
- Show quoted text -
Hi All,
I compared the output using one large image
1600 x 1200 pixels cropped to 200 x 150 in both
programs, first program uses:
com.sun.image.codec.jpeg.JPEGCodec
and the second program with the revision as suggested
above by John Matthews:
uses the classes javax.imageio.ImageIO and
java.awt.image.AffineTransformOp.
The comparison result is that the suggested
revision by John Matthews comes in second place.
It does do crop it, but is less perfect of a
crop than the first method listed.
For instance in the second program,
the image is not as sharp and clear.
bH
My guess would be that AffineTransormOP uses those very same CODECS.
There are several options that can be specified to tune the result. Why
don't you post your code and a sample image.
--
Knute Johnson
X-Hamster-Info: Score=0 ScoreLoad=0 ScoreSave=0 Received 111223030705
Xref: localhost comp.lang.java.programmer:32314
Path: news.ett.com.ua!news.ecp.fr!aioe.org!.POSTED!not-for-mail
From: Roedy Green <see_website@mindprod.com.invalid>
Newsgroups: comp.lang.java.programmer
Subject: Re: Custom fonts
Date: Thu, 22 Dec 2011 06:55:29 -0800
Organization: Canadian Mind Products
Lines: 32
Message-ID: <nlg6f71jfpkase3fqqb5mu75m9uat1iiu7@4ax.com>
References: <pbume7t2jg4rqd68sbivlh6c6ks1di3nmj@4ax.com>
Reply-To: Roedy Green <see_website@mindprod.com.invalid>
NNTP-Posting-Host: Z2l1DcCELS0rATq8NqV4Sw.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
X-Notice: Filtered by postfilter v. 0.8.2
X-Newsreader: Forte Agent 6.00/32.1186
X-Old-Xref: news.ett.com.ua comp.lang.java.programmer:82212
On Fri, 16 Dec 2011 09:07:38 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :
Has anyone used a scheme where you use a proprietary font on your
webpages or in your Applet.
Tiresias is a public domain font for the visually challenged. I have
set up some webpages with it using the @font-face feature. You can see
if I got it right by looking at
http://mindprod.com/carol/carols.html
I have posted the lyrics to 81 Christmas carols. If all is working,
you should see them in large Tiresias font.
If it does not work, you can still install the font manually.
Unfortunately, I have it in TTF form only and the font is locked so I
can't convert it to other formats.
I have yet to uninstall Tiresias and test with all the browsers to see
which support it. I suspect IE will fail since it want s eot fonts.
Given that fonts are just data, it should be possible to support all
fonts everywhere. I don't know why there are so many formats.
Adobe encrypted PS to start, which forced the creation of TrueType,
but I don't know why the others were created.
--
Roedy Green Canadian Mind Products
http://mindprod.com
If you can't remember the name of some method,
consider changing it to something you can remember.