When I try to use the code below on a machine the software was developed on,
the code cannot find the following file (which should be a "standard" java
color profile in the local cmm directory. Does anyone have a clue what I'm
doing wrong?
Regards,
Kurt
::::::::::::::: Code to save JPEG ::::::::::::::::::::::
public void writejpeg(BufferedImage outIm) {//BufferedImage bi) {
if (outIm == null) {
JOptionPane.showMessageDialog(this, "Cannot write file.\nThere
is no image to save.","File Write Problem",JOptionPane.WARNING_MESSAGE);
return;
}
jFCchooser.setDialogTitle("Save Image");
ImageOutputStream ios = null;
int returnVal = jFCchooser.showSaveDialog(this);
Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
ImageWriter writer = (ImageWriter)writers.next();
ImageWriteParam param = writer.getDefaultWriteParam();
Float quality = new Float(1.0);
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
param.setCompressionQuality(1.0f);
// ImageIO.write(myImage, "jpg", imageFile);
if(returnVal == JFileChooser.APPROVE_OPTION) {
IIOParamController controller = param.getController();
if (controller != null) {
controller.activate(param);
}
try {
ios =
ImageIO.createImageOutputStream(jFCchooser.getSelectedFile());
} catch (IllegalArgumentException ia){
System.err.println("IllegalArgumentException - if output is
null. ");
} catch (IOException IOe) {
System.err.println("a cache file is needed but cannot be
created.");
}
writer.setOutput(ios);
try {
writer.write(null, new IIOImage(outIm,null,null), param);
} catch (IllegalStateException IE) {
System.err.println("The output has not been set.");
} catch (IllegalArgumentException IAE){
System.err.println("Image is null.");
} catch (IOException IOe){
System.err.println("An error occured during writing.");
}
writer.dispose();
try {
ios.close();
} catch (IOException e){
}
}
}
Kurt M Peters - 08 Nov 2005 14:10 GMT
The file is: PYCC.pf. Sorry.
K
> When I try to use the code below on a machine the software was developed
> on, the code cannot find the following file (which should be a "standard"
[quoted text clipped - 58 lines]
>
> }
Roedy Green - 08 Nov 2005 14:30 GMT
On Tue, 08 Nov 2005 14:10:14 GMT, "Kurt M Peters"
<nospampeterskurt@msn.com> wrote, quoted or indirectly quoted someone
who said :
>The file is: PYCC.pf. Sorry.
What did the error message say exactly. Please do not paraphrase. The
key may be in the details of that error message.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green - 08 Nov 2005 14:56 GMT
On Tue, 08 Nov 2005 14:30:42 GMT, Roedy Green
<my_email_is_posted_on_my_website@munged.invalid> wrote, quoted or
indirectly quoted someone who said :
>>The file is: PYCC.pf. Sorry.
the file belongs in C:\Program Files\Java\jre1.5.0_05\lib\cmm\PYCC.pf
and also
E:\Program Files\Java\jdk1.5.0_05\jre\lib\cmm\PYCC.pf
If it is not there, you probably have other damage as well.
I suggest uninstalling all JAVA and manually deleting the java
directories.
To be really sure wipe out all traces of JAVA from the registry too.
See http://mindprod.com/jgloss/registry.html
Then reinstall JDK 1.5.0_05.
Then test your JRE. See http://mindprod.com/jgloss/jre.html#TESTING
If the file is there, try testing your JRE. You may have have two JVMs
installed which are interfering with each other.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green - 08 Nov 2005 14:21 GMT
On Tue, 08 Nov 2005 13:45:10 GMT, "Kurt M Peters"
<nospampeterskurt@msn.com> wrote, quoted or indirectly quoted someone
who said :
>When I try to use the code below on a machine the software was developed on,
>the code cannot find the following file (which should be a "standard" java
>color profile in the local cmm directory. Does anyone have a clue what I'm
>doing wrong?
what exactly did it say?
What do you mean "following file"

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.