Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

JPEG Image writer problem

Thread view: 
Kurt M Peters - 08 Nov 2005 13:45 GMT
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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.