Problem w/saving simple image as .png

Hello:                                                                                                                            Level: Newbie'ish   OS: Win7 64bit   PS: CS6
I have been making a simple image of a 300 by 100 rounded rectangle and then adding various layer styles. Basically I am makeing mobile headers which will be used for mobile websites.
Today I was reviewing  a few that I have made and noticed that when I open them in their .png format and then create a selection around one (Ctrl + Click) that the lower right coner is not being selected as rounded but as a point and so when I copy and then paste it into a new document it has three rounded corners and one somewhat visible pointed corner.  ?? ??
The file has a BG layer and two shape layers (or sometimes just one shape layer). I select the layers and then merge them together and turn off the BG layer beofore I save them for the web. I have also tried just saving the file as a .png w/out merging the layers but no matter how I go about saving the file(s) most of the time one corner is saved w/that annoying and imperfect sharp corner.
Any ideas? Your time is greatly appreciated ~ Thanx a Bunch!!

Hey c.pf...
sorry for just getting back ~ the holiday season has me run'n Crazy.
any way, i figured out my problem. i hadn't realized that i accidentally clicked the outer glow option and it was so faint that i couldn't see it all that well or actually ~ at all until i went back through the LS ...
so, when i would save the image (mobile header) it was including or making room for the outer glow
funny how something so simple can be overlooked.
well, sorry for bothering ya over nothing ~ but i really appreciate your willingness to help me out
hope all is well!! thanx again!

Similar Messages

  • Saving an image as PNG to a specific location, and appending the document's existing name.

    Hello
      I'm building a very complex action that references several scripts. One of the scripts needs to save the existing canvas as a .png file to a specific directory, and rename the .png with the document's existing name and adding "-SCREEN" to the end. So the name sould be "originalname-SCREEN.png"
      I found a script below that almost kinda works. It can find the directory, but it is cropping the image for some unknown reason. It also does not append the name (I have not looked into how to do that at all yet).
      Is anyone able to figure out how to fix this script, or perhaps lend some insight to how I might go about generating a new script?
      I'm not familiar with JS, but I'm learning. Slowly...
    Thank you.
    #target photoshop
    app.bringToFront();
    $.level = 0;
    // Globals
    Settings = {
      storedPaths: {},
      storedSelections: {},
      scriptName: "Save PR JPG LANDING",
      units: "pixels"
    // Main entry point
    main();
    function main() {
      var formatOptions;
      // Create JPEG save options
      formatOptions = formatJPEG(FormatOptions.OPTIMIZEDBASELINE, "10", "3", MatteType.NONE, true);
      // Save copy of document as
      docSaveAs(formatOptions, "Add After", "-LANDING", "No Change", "Path", "~/Desktop/PR/Landing Page (RGB | 105px W x 108px H | 72ppi)/", "");
    // Functions
    function docSaveAs(formatOptions, nameChange, nameText, newCase, destType, destRef, storeName) {
      var hasPath, f, name, nameArray, n, ext;
      if (!documents.length) { logErr(arguments, "noOpenDocs"); return; }
      if (!formatOptions) { logErr(arguments, "noFormatOptions"); return; }
      if (nameChange=="Replace" && !nameText) { logErr(arguments, "badNameValue"); return; }
      f = fileGetFolder(destType, destRef);
      if (!f) { logErr(arguments, "noDestFolder"); return; }
      try { activeDocument.path; hasPath=true; } catch(e){ hasPath=false; }
      name = activeDocument.name;
      if (hasPath) {
      nameArray = name.split(".");
      n = nameArray.length-1;
      ext = nameArray[n];
      switch (nameChange) {
      case "Add Before": nameArray[0] = nameText + nameArray[0]; break;
      case "Add After": nameArray[n-1] = nameArray[n-1] + nameText; break;
      case "Replace": nameArray = [nameText, ext]; break;
      name = nameArray.join(".");
      else {
      ext = {"[BMPSaveOptions]":".bmp", "[DCS1_SaveOptions]":".eps", "[DCS2_SaveOptions":".eps",
      "[EPSSaveOptions]":".eps", "[GIFSaveOptions]":".gif", "[JPEGSaveOptions]":".jpg",
      "[PhotoshopSaveOptions]":".psd", "[PICTFileSaveOptions]":".pct", "[PICTResourceSaveOptions":".pct",
      "[PixarSaveOptions]":".pxr", "[PNGSaveOptions]":".png", "[RawSaveOptions]":".raw",
      "[TargaSaveOptions]":".tga", "[TiffSaveOptions]":".tif"}[formatOptions.constructor.toString()]||"";
      switch (nameChange) {
      case "Add Before": name = nameText + name; break;
      case "Add After": name = name + nameText; break;
      case "Replace": name = nameText; break;
      if (!name) { name = "Untitled"; }
      name += ext;
      switch (newCase) {
      case "Lowercase": name = name.toLowerCase(); break;
      case "Uppercase": name = name.toUpperCase(); break;
      try {
      f = new File(f.fullName+"/"+name);
      activeDocument.saveAs(f, formatOptions, true);
      Settings.storedPaths.lastCreated = f.fullName;
      if (storeName) { Settings.storedPaths[storeName] = f.fullName; }
      catch(e) { log(arguments.callee, e); }
    function fileAppend(path, data, encoding) {
      var file;
      file = new File(path);
      file.open("a");
      if (typeof(encoding) == "string") {file.encoding = encoding;}
      file.write(data);
      file.close();
    function fileGetFolder(srcType, srcRef) {
      var path, f, msg;
      switch (srcType) {
      case "Last Created": path = Settings.storedPaths.lastCreated; break;
      case "Path": path = srcRef; break;
      case "Named Path": path = Settings.storedPaths[srcRef.toLowerCase()]; break;
      if (!path) {
      msg = "Select a folder:";
      if (Settings.lastFolderPath) { f = new Folder(Settings.lastFolderPath).selectDlg(msg); }
      else { f = Folder.selectDialog(msg); }
      if (f&&f.exists) { Settings.lastFolderPath = f.fsName.split("\\").join("/")+"/"; }
      else { f = new Folder(path); }
      if (!f||!f.exists) { logErr(arguments, "noFileSystemPath"); return; }
      return f;
    function fileWrite(path, data, encoding) {
      var file;
      file = new File(path);
      if (file.exists) {file.remove();}
      file.open("e");
      if (typeof(encoding) == "string") {file.encoding = encoding;}
      file.write(data);
      file.close();
    function formatJPEG(format, quality, scans, matte, embed) {
      var result = new JPEGSaveOptions();
      try {
      result.formatOptions = format;
      result.quality = parseInt(quality);
      result.scans = parseInt(scans);
      result.matte = matte;
      result.embedColorProfile = embed;
      catch(e) { log(arguments.callee, e); }
      return result;
    function log(v, err, msg) {
      // Initialization
      if (!Settings.debug) {
      var pathArray, date, str;
      Settings.debug = {
      delim:String.fromCharCode(13, 10),
      path: Folder.userData+ "/Script Builder Files/" +Settings.scriptName+ " - Log.txt",
      text:""
      date = new Date();
      str = "Begin debug log: " + date.toLocaleString() +Settings.debug.delim;
      str += "------------------------------------------------------------" +Settings.debug.delim;
      fileWrite(Settings.debug.path, str);
      // Error logging
      if (typeof v == "function") {
      v = "Error in " +v.name+ "(): ";
      if (err && msg) { v += msg + " " + err.message; }
      else if (err) { v += err.message; }
      else if (msg) { v += msg; }
      else { v = v.substring(0, v.length-2) + "."; }
      // Normal message logging
      else {
      if (typeof v != "string") {
      if (v == undefined) {v = "undefined";}
      else {v = v.toString();}
      if (Settings.debug.path) { fileAppend(Settings.debug.path, v + Settings.debug.delim); }
    function logErr(src, id) {
      var err = {
      badChannelValue: "Invalid channel number entered.",
      badColorValue: "Invalid color value entered.",
      badDocDimsValue: "Invalid document dimensions entered.",
      badExportValues: "Invalid file path or file name value supplied for export.",
      badNameValue: "Invalid name value supplied.",
      badNumberValue: "Invalid number value supplied.",
      badPathName: "Path name supplied is not unique.",
      badRefEdgeOuput: "Output method cannot be used when decontaminating colors.",
      badSubdivValue: "Subdivisions value must be an integer between 1 and 100.",
      badTestValue: "Invalid comparison value supplied.",
      fileError: "Could not read file.",
      fileExists: "A file of the same name already exists in the chosen location.",
      flatImagesOnly: "This function only works on flattened images.",
      layerDataError: "An error occurred while reading the layer settings.",
      logNotEnabled: "Log must be enabled in order to assign file path.",
      multiLayerOnly: "More than one layer must be selected.",
      noClipImageData: "No image data on clipboard.",
      noDocFile: "Document has never been saved.",
      noActionName: "No action name specified.",
      noActionSetName: "No action set name specified.",
      noBkgdLayer: "There is no background layer.",
      noDestFolder: "Destination folder not defined.",
      noFile: "File does not exist at the specified location.",
      noFileSystemPath: "No file or folder path was chosen.",
      noFilterImg: "Image file does not exist, or none was selected.",
      noFilterMask: "Layer has no filter mask.",
      noFolder: "Folder does not exist at the specified location.",
      noFormatOptions: "The \"formatOptions\" parameter is not defined.",
      noHTMLExporter: "The \"htmlExporter\" object does not exist or is not valid.",
      noLayerArtwork: "Layer has no image data.",
      noLayerComps: "Document has no layer comps.",
      noLayerFX: "Layer has no effects.",
      noLayerMask: "Layer has no layer mask.",
      noLogTextFile: "Log file path should point to a text file.",
      noLogFile: "Log file path does not point to a file.",
      noNameValue: "No new name entered.",
      noOpenDocs: "There are no documents open.",
      noQuicktime: "File format requires QuickTime.",
      noSelectedPath: "There is no path selected.",
      noSelection: "There is no selection.",
      noSelectionMod: "There is no selection to modify.",
      noTextExporter: "The \"textExporter\" object does not exist or is not valid.",
      noVectorMask: "Layer has no vector mask.",
      noWorkPath: "Document has no work path.",
      singleLayerOnly: "Only one layer should be selected.",
      wrongLayerKind: "Selected layer is the wrong kind for the requested action."
      }[id];
      if (err) { log(src.callee, null, err); }

    Go to  http://russellbrown.com/scripts.html
    download http://russellbrown.com/images/tips_downloads/Services_Installer_2.3.1.zip
    extract the "Services_Installer_2.3.1.zip"  do not install the extracted files instead find "Services_Installer_2.3.1.zxp" in the extracted files. This is also a zip file extract the files in it. You may need the reneme it to "Services_Installer_2.3.1.zip" first.  In the extracted files find:
    "Image Processor Pro.jsx" and "Image Processor Pro.xml" copy these to Photoshop's Presets\Scripts folder. The "Image Processor Pro: script written by Ross Huitt, [email protected] X use to contribute here but is feed up with Adobe has left. For Adobe does not fix the bugs that have been reported  in Photoshop scripting support. 
    However he will continue to support the "Image Processor Pro" script for some time.  Once installed you will find it in  Photoshop's menu File>Automate>Image Processor Pro... . This script is very powerful and configurable and is a Photoshop Plug-in that Action support so not only can use use your actions in its processing you can record its used in actions to bypass its dialog. When the action's Image Processor Pro step is played the recorded dialog setting will be used and  the script will bypass displaying its dialog.
    The Script has all the options you need to save PNG files with the original document name with custom text added.  You may be able to do what you want by just recording some simple actions and have the Image Processor Pro script include your actions as part of its processing.

  • Problem in saving the image into SQL database..

    Hello,
    In my application I have to save image file (say jpg) into the database and retrieve back and display it on the applet. I am through with grabbing the pixels of the image & sending the pixel array to the servlet but I am struck in how to store the image into the database and retrieve the same.
    Can anybody please help me in this regard... its really urgent...
    Thanks in advance
    Swarna

    Hello.
    I've been researching this problem (saving images in a MySQL database) in order to accomplish a task I was assigned to. Finally I was able to do it. I'd be glad if it will be of any use.
    First of all: the original question was related to an applet. So, the post from rkippen should be read. It says almost everything, leaving the code job for us. Since I managed to write some code, I'll put it here, but I'm not dealing with the byte transferring issue.
    To obtain a byte array from a file I'd open the file with FileInputStream and use a loop to read bytes from it and save them into a ByteArrayOutputStream object. The ByteArrayOutputStream class has a method named �toByteArray()� which returns an array of bytes (byte [] b = baos.toByteArray()) that can be transferred in a socket connection, as said by rkippen.
    My problem was to save an image captured by a web camera. I had an Image object, which I converted into a byte array and saved into the database. Eventually I had to read the image and show it to the user.
    The table in the MySQL database could be:
    CREATE TABLE  test (
      id int(11) NOT NULL auto_increment,
      img blob NOT NULL,
      PRIMARY KEY  (id)
    )I had problems trying to use the �setBlob� and �getBlob� methods in the Statement object, so I used the �setBytes� and �getBytes� methods . In the end, I liked these methods most because they where more suitable to my application.
    The database operations are:
        public int insertImage(Image image) throws SQLException {
            int id = -1;
            String sql = "insert into test (img) values (?)\n";
            PreparedStatement ps = this.getStatement(sql);  // this method is trivial
            byte [] bytes = this.getBytes(imagem); // * see below
            ps.setBytes(1, bytes);
            ps.executeUpdate();
            id = ps.getGeneratedKeys().getInt(0); //Actually I couldn't make this line work yet.
            return id;
        public Image selectImage(int id) throws SQLException {
            Image img = null;
            String sql = "select img from test where id = ?\n";
            PreparedStatement ps = getStatement(sql);
            ps.setInt(1, id);
            ResultSet rs = ps.executeQuery();
            if (rs.next()) {
                byte [] bytes = rs.getBytes(1);
                img = this.getImage(bytes); // * see below
            return img;
        }* If the bytes are read directly from a file, I think it is not necessary to convert it into an Image. Just send the bytes to the database method would work. On the other hand, if the image read form the DB will be written directly into files, the bytes obtained from rs.getBytes(1) would be enough.
    The image operations are:
        public byte [] getBytes(Image image) {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            try {
                ImageIO.write(this.getBufferedImage(image), "JPEG", baos);
            } catch (IOException ex) {
                throw new RuntimeException(ex);
            return baos.toByteArray();
        public Image getImage(byte [] bytes)  {
            Image image = null;
            ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
            try {
                image = ImageIO.read(bais);
            } catch (IOException ex) {
                throw new RuntimeException(ex);
            return image;
        public BufferedImage getBufferedImage(Image image) {
            int width = image.getWidth(null);
            int height = image.getHeight(null);
            BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2d = bi.createGraphics();
            g2d.drawImage(image, 0, 0, null);
            return bi;
        }That's it. I hope it is useful.

  • Problem in Saving Captured Images.

    Hi all,
    I am trying to save the images which are captured by the webcam. I am getting the
    error as
    JPEGEncodeTest.java:32:cannot resolve symbol
    Symbol: method getImage()
    location: class JPEGEncodeTest
    image = getImage(); (Error)
    I am trying to compile the code for saving separately first and then attach this piece of code to the main program. And the code is
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.FileOutputStream;
    import java.io.OutputStream;
    import com.sun.image.codec.jpeg.JPEGEncodeParam;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    import com.sun.image.codec.jpeg.JPEGCodec;
    public class JPEGEncodeTest
    public static void main(String[] args)
    throws Exception
    OutputStream out = null;
    BufferedImage image = null;
    try {
         image = getImage();
    // Open output file.
    out = new FileOutputStream("test.jpg");
    // Create jpeg encoder.
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    // Set quality.
    JPEGEncodeParam encodeParam = encoder.getDefaultJPEGEncodeParam(image);
    encodeParam.setQuality(0.7f, false);
    // Encode.
    encoder.encode(image, encodeParam);
    // Close output file.
    out.close();
    } catch(java.io.IOException io)
         System.out.println("Java IO Exception");
    If anyone has encountered the getImage function not to work and have figured it out, please let me know. Or If anyone has any suggestions in this issue, please let me know. I am really thankful to all of you as I need this to work as soon as possible and am unable to think of how to solve it.
    Sorry for the inconvenience.
    In Advance thanks to all of you.
    padmaja.

    according to the error posted, and the code posted. there is no method getImage();
    image = getImage();//you have this line, this is where error is, Where is getImage()???Is getImage() in a different class???
    you need something like this in the code above....
    public Image getImage(){
    .....add the above code to your posted code then, what is the error.

  • Problem with saving Contact Images?

    In the process of creating a new contact, I took a photo of someone I probably won't see for awhile instead of choosing an existing photo. But when I look for under "camera roll"... I don't see it there. But it still happens to be under the contact. I know you can extract the photos from my computer, but when I tried looking for it in the 100apple folder, it wasn't there.
    My question, do you know where I can find the image I took after choosing "take image" under the contact menu? Especially if I don't use Outlook for sync my contacts... Thanks!

    docs44 wrote:
    I think you misunderstood what the person was saying. looking in the 100App folder doesn't mean it is jailbroken. Mine's not and I can access that. When connect your iPhone to the computer you get the message asking if you want to view the files. Or when it's connected you can go to "my computer" on a PC and access the photos that way too. If you choose to then you can access those files which have photos. The same photos as the camera roll.
    Thank you for the clarification.
    But yes, since he took the photo from the Contacts App and assigned directly from there as opposed to taking a pic with the Photo app and then assigning with an existing photo, the photo doesn't go to the camera roll but just to the contacts database (which is off limits to users). The best he can do is sync and get it from his Address book (though much smaller).

  • Trouble saving the image, save as button not working

    i'm having trouble in saving the image in PNG format, it seems that the "save as" button is not working properly, what should i do?

    Save from what program? On what system? In any case, ask in the product forum of whatever program you are referring to...
    Mylenium

  • Saving an image in Root folder of tomcat

    Hello,
    i have an urgent problem with saving an image in the root folder of tomcat, which I want to do without having to specify the entire path.
    I have created a class, which i use as a bean in a jsp to save an image to the tomcat root folder.
    If I use the following command, the image is saved:
    ChartUtilities.saveChartAsJPEG(new File(
    "C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/trader/images/charts/1.jpg"), chart, 550, 260);
    However, I should be doing it like this, which doesn't work and throws me an IO exception:
    ChartUtilities.saveChartAsJPEG(new File("images/charts/1.jpg"), chart, 550, 260);
    Cheers

    Didn't we have this discussion in another thread? You can't give something urgently. It's semantically anaphoricular.

  • Saving image as png

    Hi, i have a simple question, at least i hope so...:
    i tried to save an image in png file format. I tried several possibilities, but always its saying, that its not an image.
    I used "IMAQ Writefile" for this, but the same problem occures with similar VI's. Drawing the image with "IMAQ winddraw" works though.
    So i want to know, if someone could tell me the simplest way of how i can save an image?
    THX
    Sometimes my knowledge is just ... .... lol
    Attachments:
    partbeforsaving.vi ‏27 KB

    Hello,
    Here is a little help.
    I think you need to learn about the basics IMAQ functions, I suggest you have a look at some example (Help > Find Examples and then search for IMAQ).
    Hope this helps
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    help.vi ‏14 KB

  • Problem in saving image to jpg

    Hello.
    I've got a problem in saving a LabView Picture in a jpg File.
    The picture id grabbed from a DirectX Livestream from a camera.
    Then I want to save it in a jpg file using the Standard LabView Functions.
    But all I get is an empty jpg File and an error:
    Check_Data_size.vi
    Error 1
    I'm using LabView 7.1.
    Has anybody got an idea how to solve the problem?

    No.  You can save a gray image to jpg, but I has to be 24 bit.
    Try save your data to bmp.  If you got the same problem, that means you fail to wire correct data format to the LabVIEW VI you're using.
    George Zou
    http://gtoolbox.yeah.net
    George Zou
    http://webspace.webring.com/people/og/gtoolbox

  • I am using adobe photoshop cs6. I am facing a problem. When i save any image as "save for web". After saving image it show cropped. An image show many parts of the image after saving the image. Please help me. Thanks in advance.

    I am using adobe photoshop cs6. I am facing a problem. When i save any image as "save for web". After saving image it show cropped. An image show many parts of the image after saving the image. Please help me. Thanks in advance.

    Just go back in photoshop and use the Slice Select tool, then just click and select the slice and hit delete - if you're not sure which one is the active slice just right click and find the one that has the Delete Slice option.
    It's possible you either added the slices by accident or if you received it from someone they just had the slices hidden. For the future, you can go to View > Show > Slices to display (or hide) slices.

  • I am having problems saving certain images

    I am having problems saving certain images. For example, on Ebay while viewing an auction item, when you click on the image to view the larger picture it opens in a new window. With Internet Explorer, you can "right-click" and "save picture as". With Firefox 3.6.9 the "save picture as" option is not availabale. Other options such as save "save page as" are available, but not "save as," or "save picture as." Any ideas? Thanks

    I have found a solution to the problem. Apparently there is an addon to fix this. Had no idea a specific google search for "trouble saving images on ebay" would turn up anything.
    https://addons.mozilla.org/en-US/firefox/addon/13802/

  • Create image problem.it is simple problem every on knows.

    hi all!
    i hv a problem in runing an image program.i hv this program
    from a tutorial and an io exception occurs what is wrong with code.<b>I m using jbuilder 6 and also keeping image in src folder.</b>
    thanks earlier;here is my simplest code:-
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import java.util.*;
    public class PhoneImage1 extends MIDlet
    implements CommandListener,
    ItemStateListener {
    private Command exitCommand;
    //The display for this MIDlet
    private Display display;
    Form displayForm;
    Image image;
    public PhoneImage1() {
    display = Display.getDisplay(this);
    exitCommand = new Command("Eit", Command.SCREEN, 2);
    try
    image = Image.createImage("JavaP.png");
    catch (java.io.IOException ioExc)
    ioExc.printStackTrace();
    public void startApp() {
    displayForm = new Form("Imagitem");
    displayForm. append(
    new ImageItem("Default Layout",
    image,
    ImageItem.LAYOUT_DEFAULT,
    "Image Cannot be shown"));
    displayForm.addCommand(exitCommand);
    displayForm.setCommandListener(this);
    displayForm.setItemStateListener(this);
    display.setCurrent(displayForm);
    public void itemStateChanged(Item item)
    <br>
    public void pauseApp() { }
    public void destroyApp (boolean unconditional) { }
    public void commandAction (
    Command c, Displayable s) {
    if (c == exitCommand) {
    destroyApp(false);
    notifyDestroyed();
    }

    thank u it is now working by u r first solution.i hv another
    question if u hv time plz,i m putting this code in form
    form=new form("\u639\u634\u634");
    it is giving me unicode characters but not in concatenated form but
    it is giving me each character separately and so no valid world becomes.
    More over i m doing work on internationalization on mobile plz can u
    give me some help by giving some suggestion.
    thanx again.

  • Saving images to PNG

    Hi,
    I'm trying to save my images to PNG so that I can upload them on the web. I need the images to be a specific size - which I stipulate via the artboard size.
    However when I try to save my images (via File, Save for Web and Devices) the image never saves to the size/outline of the artboard.
    Does anyone know why this happens and how I can get my images to save to the pixel size that I need?
    I'm using Windows 7 and have Illustrator CS5
    Thanks

    When you create your original document do you set the profile to Web and check that the ppi/dpi settings are the same as the output you need for your webpage?

  • Problem in Saving Image Code

    Hi, I'm been dealing with this code that should be saving an image as a JPEG format.
    public static void saveAsJPEG(RenderedImage image, String file)
    throws java.io.IOException {
    String filename = file;
    if(!filename.endsWith(".jpg"))
    filename = new String(file+".jpg");
    OutputStream out = new FileOutputStream(filename);
    JPEGEncodeParam param = new JPEGEncodeParam();
    ImageEncoder encoder = ImageCodec.createImageEncoder("JPEG", out, param);
    encoder.encode(image); out.close(); }
    However, when I compile the code, there's an error come out : com.sun.image.codec.jpeg.JPEGEncodeParam is abstract; cannot be instantiated
    I really can't figure out the meaning of this exception. So, would somebody kindly tell me what is wrong with the code?
    And another question is : What package is the ImageCodec located? Thanks a lot :)

    try this out and let me know;
    public static void saveAsJPEG(BufferedImage image, String file)
    throws java.io.IOException {
    String filename = file;
    if(!filename.endsWith(".jpg")) filename = new String(file+".jpg");
    OutputStream out = new FileOutputStream(filename);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out); // Create JPEG encoder
    JPEGEncodeParam jpegParams = encoder.getDefaultJPEGEncodeParam(image);
    jpegParams.setQuality(1.0f, false); // Set quality to 100% for JPEG
    encoder.setJPEGEncodeParam(jpegParams);
    encoder.encode(image); // Encode image to JPEG and send to browser
    //JPEGEncodeParam jpegPparams = new JPEGEncodeParam();
    //ImageEncoder encoder = ImageCodec.createImageEncoder("JPEG", out, jpegParams);
    //encoder.encode(image);
    out.close(); }

  • Why is Firefox 10 insisting on saving images (jpg, png,gif) as filename.extension.rb?

    After I upgraded to Firefox 10, when I attempt to save images, for example, the firefox-54x62.png on this page, Firefox offers to save the image as "firefox-54x62.png.rb" with image type "PNG image"

    Inspect the MIME database key with the registry editor (regedit.exe) and do a search for that MIME type (file extension) via Ctrl+F.<br />
    Be careful with editing the registry as there is no Undo possible: all changes are applied immediately.<br />
    You can export key(s) before making changes.<br />
    MIME Database : HKEY_CLASSES_ROOT\MIME\Database\Content Type
    You can also check those file extension in the main HKEY_CLASSES_ROOT\ branch.

Maybe you are looking for