CROPPING and SAVING makes images disappear

Cropping and saving makes my images disappear in CS5 Extended

I have Mac OS 10.7.5 and Photoshop CS5 Extended. I cropped both a jpeg and tif file/photo
and then saved it - save as and/or save - and the image disappeared. The only thing that was visible was the file title with .jpeg or.tif extension, and the gray box or outline that goes around the image, but also some of the images the thumbnail image was gone too - just a title was visible on the desktop screen where I saved it. Are these images gone? Where are they? Where did they go and how do I get them back? And why is my crop tool and save doing this and how do I fix it?
I was able to make other corrections like using Curves to photos and saved them with no problem. Just the crop tool does makes the images do this after or before I save it
Thanks for any help you can provide.

Similar Messages

  • Load, crop and saving jpg and gif images with JFileChooser

    Hello!
    I wonder is there someone out there who can help me with a applic that load, (crop) and saving images using JFileChooser with a simple GUI as possible. I'm new to programming and i hope someone can show me.
    Tor

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.filechooser.*;
    import javax.swing.filechooser.FileFilter;
    public class ChopShop extends JPanel {
        JFileChooser fileChooser;
        BufferedImage image;
        Rectangle clip = new Rectangle(50,50,150,150);
        boolean showClip = true;
        public ChopShop() {
            fileChooser = new JFileChooser(".");
            fileChooser.setFileFilter(new ImageFilter());
        public void setClip(int x, int y) {
            clip.setLocation(x, y);
            repaint();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(image != null) {
                int x = (getWidth() - image.getWidth())/2;
                int y = (getHeight() - image.getHeight())/2;
                g2.drawImage(image, x, y, this);
            if(showClip) {
                g2.setPaint(Color.red);
                g2.draw(clip);
        public Dimension getPreferredSize() {
            int width = 400;
            int height = 400;
            int margin = 20;
            if(image != null) {
                width = image.getWidth() + 2*margin;
                height = image.getHeight() + 2*margin;
            return new Dimension(width, height);
        private void showOpenDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    image = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("Read error for " + file.getPath() +
                                       ": " + e.getMessage());
                    image = null;
                revalidate();
                repaint();
        private void showSaveDialog() {
            if(image == null || !showClip)
                return;
            if(fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                String ext = ((ImageFilter)fileChooser.getFileFilter()).getExtension(file);
                // Make sure we have an ImageWriter for this extension.
                if(!canWriteTo(ext)) {
                    System.out.println("Cannot write image to " + ext + " file.");
                    String[] formatNames = ImageIO.getWriterFormatNames();
                    System.out.println("Supported extensions are:");
                    for(int j = 0; j < formatNames.length; j++)
                        System.out.println(formatNames[j]);
                    return;
                // If file exists, warn user, confirm overwrite.
                if(file.exists()) {
                    String message = "<html>" + file.getPath() + " already exists" +
                                     "<br>Do you want to replace it?";
                    int n = JOptionPane.showConfirmDialog(this, message, "Confirm",
                                                          JOptionPane.YES_NO_OPTION);
                    if(n != JOptionPane.YES_OPTION)
                        return;
                // Get the clipped image, if available. This is a subImage
                // of image -> they share the same data. Handle with care.
                BufferedImage clipped = getClippedImage();
                if(clipped == null)
                    return;
                // Copy the clipped image for safety.
                BufferedImage cropped = copy(clipped);
                boolean success = false;
                // Write cropped to the user-selected file.
                try {
                    success = ImageIO.write(cropped, ext, file);
                } catch(IOException e) {
                    System.out.println("Write error for " + file.getPath() +
                                       ": " + e.getMessage());
                System.out.println("writing image to " + file.getPath() +
                                   " was" + (success ? "" : " not") + " successful");
        private boolean canWriteTo(String ext) {
            // Support for writing gif format is new in j2se 1.6
            String[] formatNames = ImageIO.getWriterFormatNames();
            //System.out.printf("writer formats = %s%n",
            //                   java.util.Arrays.toString(formatNames));
            for(int j = 0; j < formatNames.length; j++) {
                if(formatNames[j].equalsIgnoreCase(ext))
                    return true;
            return false;
        private BufferedImage getClippedImage() {
            int w = getWidth();
            int h = getHeight();
            int iw = image.getWidth();
            int ih = image.getHeight();
            // Find origin of centered image.
            int ix = (w - iw)/2;
            int iy = (h - ih)/2;
            // Find clip location relative to image origin.
            int x = clip.x - ix;
            int y = clip.y - iy;
            // clip must be within image bounds to continue.
            if(x < 0 || x + clip.width  > iw || y < 0 || y + clip.height > ih) {
                System.out.println("clip is outside image boundries");
                return null;
            BufferedImage subImage = null;
            try {
                subImage = image.getSubimage(x, y, clip.width, clip.height);
            } catch(RasterFormatException e) {
                System.out.println("RFE: " + e.getMessage());
            // Caution: subImage is not independent from image. Changes
            // to one will affect the other. Copying is recommended.
            return subImage;
        private BufferedImage copy(BufferedImage src) {
            int w = src.getWidth();
            int h = src.getHeight();
            BufferedImage dest = new BufferedImage(w, h, src.getType());
            Graphics2D g2 = dest.createGraphics();
            g2.drawImage(src, 0, 0, this);
            g2.dispose();
            return dest;
        private JPanel getControls() {
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weightx = 1.0;
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.gridwidth = GridBagConstraints.REMAINDER;
            panel.add(getCropPanel(), gbc);
            panel.add(getImagePanel(), gbc);
            return panel;
        private JPanel getCropPanel() {
            JToggleButton toggle = new JToggleButton("clip", showClip);
            toggle.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    showClip = ((AbstractButton)e.getSource()).isSelected();
                    repaint();
            SpinnerNumberModel widthModel = new SpinnerNumberModel(150, 10, 400, 1);
            final JSpinner widthSpinner = new JSpinner(widthModel);
            SpinnerNumberModel heightModel = new SpinnerNumberModel(150, 10, 400, 1);
            final JSpinner heightSpinner = new JSpinner(heightModel);
            ChangeListener cl = new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    JSpinner spinner = (JSpinner)e.getSource();
                    int value = ((Number)spinner.getValue()).intValue();
                    if(spinner == widthSpinner)
                        clip.width = value;
                    if(spinner == heightSpinner)
                        clip.height = value;
                    repaint();
            widthSpinner.addChangeListener(cl);
            heightSpinner.addChangeListener(cl);
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            gbc.weightx = 1.0;
            panel.add(toggle, gbc);
            addComponents(new JLabel("width"),  widthSpinner,  panel, gbc);
            addComponents(new JLabel("height"), heightSpinner, panel, gbc);
            return panel;
        private void addComponents(Component c1, Component c2, Container c,
                                   GridBagConstraints gbc) {
            gbc.anchor = GridBagConstraints.EAST;
            c.add(c1, gbc);
            gbc.anchor = GridBagConstraints.WEST;
            c.add(c2, gbc);
        private JPanel getImagePanel() {
            final JButton open = new JButton("open");
            final JButton save = new JButton("save");
            ActionListener al = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JButton button = (JButton)e.getSource();
                    if(button == open)
                        showOpenDialog();
                    if(button == save)
                        showSaveDialog();
            open.addActionListener(al);
            save.addActionListener(al);
            JPanel panel = new JPanel();
            panel.add(open);
            panel.add(save);
            return panel;
        public static void main(String[] args) {
            ChopShop chopShop = new ChopShop();
            ClipMover mover = new ClipMover(chopShop);
            chopShop.addMouseListener(mover);
            chopShop.addMouseMotionListener(mover);
            JFrame f = new JFrame("click inside rectangle to drag");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(chopShop));
            f.getContentPane().add(chopShop.getControls(), "Last");
            f.pack();
            f.setLocation(200,100);
            f.setVisible(true);
    class ImageFilter extends FileFilter {
        static String GIF = "gif";
        static String JPG = "jpg";
        static String PNG = "png";
        // bmp okay in j2se 1.5+
        public boolean accept(File file) {
            if(file.isDirectory())
                return true;
            String ext = getExtension(file).toLowerCase();
            if(ext.equals(GIF) || ext.equals(JPG) || ext.equals(PNG))
                return true;
            return false;
        public String getDescription() {
            return "gif, jpg, png images";
        public String getExtension(File file) {
            String s = file.getPath();
            int dot = s.lastIndexOf(".");
            return (dot != -1) ? s.substring(dot+1) : "";
    class ClipMover extends MouseInputAdapter {
        ChopShop component;
        Point offset = new Point();
        boolean dragging = false;
        public ClipMover(ChopShop cs) {
            component = cs;
        public void mousePressed(MouseEvent e) {
            Point p = e.getPoint();
            if(component.clip.contains(p)) {
                offset.x = p.x - component.clip.x;
                offset.y = p.y - component.clip.y;
                dragging = true;
        public void mouseReleased(MouseEvent e) {
            dragging = false;
        public void mouseDragged(MouseEvent e) {
            if(dragging) {
                int x = e.getX() - offset.x;
                int y = e.getY() - offset.y;
                component.setClip(x, y);
    }

  • Loading, cropping and saving jpg files in Flex

    I'm attempting to apply the code for selecting, cropping and saving image data (.jpg, .png) as shown on the web site:
    http://www.adobe.com/devnet/flash/quickstart/filereference_class_as3.html#articlecontentAd obe_numberedheader_1
    The sample application is contained within a class called Crop contained in the action script file Crop.as which begins as follows:
    package
        import com.adobe.images.JPGEncoder;
        import com.adobe.images.PNGEncoder;
        import flash.display.BitmapData;
        import flash.display.DisplayObject;
        import flash.display.DisplayObjectContainer;
        import flash.display.Loader;
        import flash.display.LoaderInfo;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.IOErrorEvent;
        import flash.events.MouseEvent;
        import flash.geom.Matrix;
        import flash.geom.Rectangle;
        import flash.net.FileFilter;
        import flash.net.FileReference;
        import flash.utils.ByteArray;
        public class Crop extends Sprite
    My application attempts to make use of the Crop class by including the Crop.as file:
         <mx:Script source="Crop.as"/> 
    in the Flex Component which needs it, and then calling the Crop constructor to perform the methods of the class
       var localImage:Crop = new Crop();
       localImage.Crop();
    My application does not compile. The package statement (or the curly bracket on the following line) is flagged with the error "Packages may not be nested".
    I have no idea why this should be as I cannot see any nested definitions anywhere in my application. The component includes the Crop.as file which contains the package and class definition.
    Can anyone give my some guidance as to why this error is occurring?
    Any help would be greatly appreciated.  

    Hi Scott,
    #1
    that error is because "fx:Script" (or mx:Script) are intended to include part of Actionscript code - but not class defitions or blocks.
    So if you are trying to include e.g. such class:
    package
         import flash.display.Sprite;
         public class Crop extends Sprite
              public function Crop()
                   super();
              public function processImage():void
                   trace("processImage()");
    compiler will immediately complain as you are trying to incorporate nested class within your application code.
    #2
    here is correct way (I think) to incorporate some class via mxml tags (here using fx:Script):
    Using class sample above:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx"
                      xmlns:utils="*"
                      applicationComplete="completeHandler(event)">
         <!-- util Crop will be initialized here as instance "cropUtil" -->
         <fx:Declarations>
              <utils:Crop id="cropUtil"/>
         </fx:Declarations>
         <!-- script where "cropUtil" will be used -->
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   protected function completeHandler(event:FlexEvent):void
                        cropUtil.processImage();
              ]]>
         </fx:Script>
    </s:Application>
    But note that you could simply create instance of your class by direct import in fx:Script:
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   private var cropUtil:Crop = null;
                   protected function completeHandler(event:FlexEvent):void
                        cropUtil = new Crop();
                        cropUtil.processImage();
              ]]>
         </fx:Script>
    hth,
    kind regards,
    Peter Blazejewicz

  • HELP!!!!  How to crop and save an image

    I recently started using iPhoto when I bought a digital camera. I have figured out pretty much how to use it but I would like to crop AND SAVE some of the pictures. I have gone so far as to crop an image and print it but the print comes out like the original shot. Also is there some way to convert these images into smaller file sizes and saving for uploading onto another website? Thanks in advance! .
    G5 2.0 DP and Powmac 7500/200   Mac OS X (10.3.9)   23" Cinema Display
    G5 2.0 DP and Powmac 7500/200   Mac OS X (10.3.9)   23" Cinema Display

    Hi imageconx1,
    I think it will do you good to read the Help file for iPhoto. While iPhoto is open, hit the Help in the menubar.
    You can also find the same info online on the iPhoto Support
    site.
    Cropping and saving image:
    http://docs.info.apple.com/article.html?artnum=165597
    Export photos and change size in the export window
    http://docs.info.apple.com/article.html?artnum=165616

  • When I have resized and saved an image in Photoshop (CS, version 8.0 for Mac) using image size, why is it so large when I open it in preview or another image viewer? Has it actually saved according to the size I specified?

    When I have resized and saved an image in Photoshop (CS, version 8.0 for Mac) using image size, why is it so large when I open it in preview or another image viewer? Has it actually saved according to the size I specified?

    You want to view the image at the Print Size, which represents the size that shows in the Image>Resize Dialog.
    View>Print Size
    Since screen resolution is almost always lower that the print resolution (somewhere between 72 and 96 usually), images will always look bigger on the screen, unless you view them at print size.
    (apple Retina displays have a much higher resolution than normal screens, closer to the average print size resolution)
    more info:
    Photoshop Help | Image size and resolution

  • Cropping and saving photos 4x6

    I cropped my photos (200 or so) using "none" as the constrain. I think in order to order the prints, I need to convert them to 4x6 photos. Two questions:
    1, Is there a way to select a whole album of pictures and then, as a group, apply the 4x6 constrain? It seemed the only way I could do it was one by one.
    2. After I did change them to the 4x6 contraint, the 4x6 sizing tool was centered. In many pictures, I wanted to drag the 4x6 to the left or right. Then I clicked crop and the picture seemed saved as a 4x6. However when I scrolled back to the picture I thought I had cropped 4x6 off center, it was back to being centered, and cutting off the heads and shoulders of people.
    So how can I crop photos 4x6 but in an off center way and save these changes so they will print correctly?

    I have Mac OS 10.7.5 and Photoshop CS5 Extended. I cropped both a jpeg and tif file/photo
    and then saved it - save as and/or save - and the image disappeared. The only thing that was visible was the file title with .jpeg or.tif extension, and the gray box or outline that goes around the image, but also some of the images the thumbnail image was gone too - just a title was visible on the desktop screen where I saved it. Are these images gone? Where are they? Where did they go and how do I get them back? And why is my crop tool and save doing this and how do I fix it?
    I was able to make other corrections like using Curves to photos and saved them with no problem. Just the crop tool does makes the images do this after or before I save it
    Thanks for any help you can provide.

  • Script : Crops and name one image

    Hello there,
    I'm completely new with scrip on photoshop.. I know there is a way to use one image for different crops and name them. There is no batch involve.
    Which means :
    -Click on the script, a croping open, crop it, got a message saying if the crop is okay, click okay, then a box open, you can choose a name and save, then it follows by two others similar crops.
    Sorry, not easy to explain. Is that a plug or a script? or both?
    I basically end up using one image for 4 different crops and names, with a file saving like ??_xx_xx_xx_?? (?? : the name I selected, xx : the name of the image)
    How to code this, is anyone knows?
    Thank you!

    endofthenight wrote:
    Without having javascript or coding knowledge I won't be able to recreate this tomorrow......... ahh
    No
    While program knowledge would enable you to create a fully automated process you can do what you want to do with an action without any programming.  It can not be done without thinking and planing.  While recording an action is extremely easy to do. Crafting an action like you described takes some knowledge, planning, skill and practice.
    Adobe forums like this one is a good place to acquire missing knowledge.  There are many here with a lot of knowledge that are willing to help other learn.
    First the thread belongs in the Photoshop General Discussion forum this forum is for users interested in scripting. Scripting is use by a very small subset of Photoshop users with programming skills and is best outside the other main stream forum.
    As I wrote I would have no problem crafting an action like you want.  However if I do you learn very little and I think perhaps I just been used.  If you have a problem recording the action you can ask how would some one do this or that.  Then perhaps many would respond with how they woul do something.  You and otheres  would see how other do something. Some of the ways may be better the others.  You can take your pick.  The important to to me is knowledge is being learned and spread.   Photoshop help and support is the pits one of the best Photoshop resources at you disposal are these Adobe forums.
    Now I'm going to ask you a favor. Please start a new thread in the Photoshop General Discussion forum where you ask for help crafting the action  you want.  Start be describing the action you want in great detail. Also please read the text file in may crafting action package.  They are written for the advance action creator short perhaps and cryptic but they detail some of the capability of the Actions Palette, contains some good guide lines to follow. Address the issue of document size a problem area many have problem with, It also provide some script written to be used within Actions so the action creator can record better action with some logic in them without the need programming the script. 

  • Crop and fill with image

    Hello
    I intend to use lasso for free style cropping an image, but I want to the fill in that cropped section with another image. I intend to , say crop a dress floral pattern on a sleeve, and fill it with another floral pattern of my choice.
    Thanks

    Hi there,
    Here's a quick tutorial for working with masks to replace patterns and textures in an image.
    1) Here's my starting image, and I want to replace the fabric on the pocket of this shirt.
    2) Bring in the pattern you want to incorporate into your original image by copy and pasting or by going to File > Place.
    3) With the pattern layer selected, option + click on the icon marked below to create a mask over the layer. The image will seem to disappear, but this is only because the mask is solid black— black in the mask indicates hidden areas, white areas are where the image will be revealed.
    4) Use the lasso tool to select the area in which you want the pattern to appear.
    5) Being sure the mask is selected in the layers panel, use the paint bucket to fill in the selection area with white. The pattern will appear.
    My next steps would then be to paint on the mask with black to reveal the stitched areas and the button on the pocket. Alternatively, as Silkrooster said, you can experiment with blend modes. Below is the pattern layer set to Multiply. Using this setting would work well if you were placing a pattern over a white or light-colored garment. Good luck!

  • Can you uncrop a video on iphoto that was cropped and saved by accident?

    Hello I just imported some photos to iphoto and accidentally cropped one of my videos and saved it. Is there any way to get the rest of the video back?

    select it and revert to original
    LN

  • How to undo cropped and rotated RAW images in ACR

    Can someone advise on returning to the original RAW image after the image has been edited in ACR.
    "Reset Camera Raw Defaults" seems to do everything but undo crops and image rotation.
    How do I undo these and/or return to the original unedited image?
    Many thanks

    Thanks but how exactly do I find the unedited CR2 within PSE/ACR?
    Everytime I open the file in PSE or ACR the edited version comes up and the most original version I can return to is to reset the Defaults.  However, this does not reverse crops and rotations
    I have noticed that the original CR2 file is viewable within MS Explorer but I'm reluctant to delete the .xmp as I don't want to loose keywords etc associated with the image.
    Many thanks for any suggestions

  • Applying filter to s:bitmapImage makes images disappear!?

    I wonder if anyone can help... I am attempting to apply a filter to s:bitmapImage but no matter if I do this in as3 or mxml as soon as i apply the filter the whole image disappears! I have tried this with different sorts of filter (dropshadow, glow) etc. but all do the same thing? Without any filter the image is show perfectly fine!
    The source of my s:bitmapImage is generated programmatically at runtime and is linked via a binding...
    Can anyone tell me what I am doing wrong?
    Thanks,
    Mark.

    hi,
    The following code uses a spark bitmapimage that has a blur filter and the filter seems to work with out issue.
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
       xmlns:net="flash.net.*" creationComplete="application1_creationCompleteHandler(event)">
    <fx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.utils.ObjectUtil;
    import spark.filters.BlurFilter;
    private var ldr:Loader = new Loader();
    private  function btn_click(evt:MouseEvent):void  {
    var arr:Array = [];
    arr.push(new FileFilter("Images", ".gif;*.jpeg;*.jpg;*.png"));
    fileReference.browse(arr);
    private  function fileReference_select(evt:Event):void  {
    fileReference.load();
    private  function fileReference_complete(evt:Event):void {
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
    ldr.loadBytes(fileReference.data);
    //Alert.show(ObjectUtil.toString(fileReference));
    private function onComplete(event:Event):void
    ldr.contentLoaderInfo.removeEventListener( Event.COMPLETE, onComplete );
    img.source = ldr.content;
    protected function application1_creationCompleteHandler(event:FlexEvent):void
    img.filters = [blur];
    ]]>
    </fx:Script>
    <fx:Declarations>
    <net:FileReference id="fileReference"
       select="fileReference_select(event);"
       complete="fileReference_complete(event);" />
    <s:BlurFilter id="blur" blurX="8" blurY="8"/>
    </fx:Declarations>
    <s:BitmapImage id="img" left="0" right="0" top="0" bottom="0" source ="@Embed('test.jpg')" fillMode="repeat"/>
    <s:HGroup>
    <s:Button id="btn"
       label="Browse"
       click="btn_click(event);" />
    <s:Button id="btn2"
       label="Add Filter"
       x="50"
       click="img.filters=[blur]" />
    <s:Button id="btn3"
       label="RemoveFilter"
       click="img.filters=[]" />
    </s:HGroup>
    </s:Application>

  • Graphics2D and saving the image

    my program loads different images and display them on the screen.
    my question is how can make what is displayed on the screen saved in one jpg file?
    here is the code that loads and displays the first image:
    InputStream in = getClass().getResourceAsStream(filename);
    JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(in);
    BufferedImage image = decoder.decodeAsBufferedImage();
    in.close();
    // Draw the loaded image on the offscreen image.
    g2.drawImage(image, 0, 0, this);
    the code that loads and displays the rest of the images
         for(int i=0; i<ex.length; i++){      
              String filename2 = ex[i] + ".jpg";
              //wait for the image to load
         Image img2 = getToolkit().getImage(filename2);
    loadImage(img2);
         InputStream in2 = getClass().getResourceAsStream(filename2);
         JPEGImageDecoder decoder2 = JPEGCodec.createJPEGDecoder(in2);
         BufferedImage image2 = decoder2.decodeAsBufferedImage();
         in2.close();
              g2.drawImage(image2, 50 + i*30, 120, this);
    PLEASE HELP !!!!!!:
    I already know that I need to use
    OutputStream os = new FileOutputStream("Holla.jpg");
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
    encoder.encode(imageBuffer );
    but I have many buffers here.
    Should I just add them up together into a one and encode that one?
    PLEASE HELP!!!
    Thank u.

    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    public class Example {
        public static void main(String[] args) throws IOException {
            URL url0 = new URL("http://today.java.net/jag/bio/JAG2001small.jpg");
            URL url1 = new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg");
            BufferedImage image0 = ImageIO.read(url0);
            BufferedImage image1 = ImageIO.read(url1);
            int w = image0.getWidth() + image1.getWidth();
            int h = Math.max(image0.getHeight(), image1.getHeight());
            BufferedImage result = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g = result.createGraphics();
            g.drawImage(image0, 0, 0, null);
            g.drawImage(image1, image0.getWidth(), 0, null);
            g.dispose();
            ImageIO.write(result, "jpeg", new File("result.jpeg"));
    }

  • Rotating and saving an image

    Hi, i'm trying to rotate an image and then save the rotated image to the hard drive in jpeg format. I've managed to get the rotation part working, but i can't seem to save the image correctly.

    Here is some code. You'll need to catch exceptions etc.
    BufferedImage expImage = new BufferedImage( (int)component.getWidth(), (int)component.getHeight(), BufferedImage.TYPE_INT_RGB );
                   Graphics g2d = expImage.getGraphics();
                   draftGrid.update(g2d);
                   layoutGrid.update(g2d);
                   g2d.dispose();
                        fileName = verifyFileName(fileName, "jpeg");
                        OutputStream out = new FileOutputStream( fileName );
                        JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
                        encoder.encode(expImage);
                        out.flush();
                        out.close();
                        expImage.flush();
    /** This draft has been saved to fileName **/

  • Saving Makes Images Blurry but in preview it's normal?

    used to use photostudio 5 but PS CS3 is supposed to be alot better so i got this and everytime i save it, (in mypictures folder) the preview and everything looks fine, but once i close the folder out and go back, it looks blurry and when i upload it to the web, its really blurry...whats going on with this program, its driving me crazy bc i wanna make a poster...can someone help me please, im new to this!

    Double post

  • The trial version of Adobe photoshop 13 does not have the Crop And Straighten Photos option  under file and automate....... all it has is "Fit Image".......   would really like to have that feature.... is it something they eliminated?

    I am scanning in many old photos and there are several photos on one page.... I read about a feature that was suppose to be available under adobe photo shop elements 13 that would allow multiple cropping under the file, automate, Crop And Straighten Photos....... the only thing that displays on the version 13 that I have is "Fit Image"...... which doesn't help me......    have they removed this tool or do you have to crop and save one image at a time?    Thanks for your help?

    You want Image>Divide Scanned Photos

Maybe you are looking for

  • Is there a way to change the actual song file but keep the 'info'?

    I have a compilation that took me a really long time to edit (by which I mean put the date for each individual song in because they were all released different years becaues it's a Bob Dylan compilation and I have smart playlists for each decade from

  • Update was terminated received from author in sap iw32(During changing the settlement rule)

    Hi, I am getting an error "Express Document 'Update Was Terminated' Received from Author" when i am adding the settlement receiver. New settlement receiver is from period 03.2015. changed the ref object(functional location) and the tried to add the s

  • Interesting PCD bug? Runaway process creating objects?

    Currently, we are on EP 6 sp 16. We have had a very interesting situation occur with our development portal at random times. Not always, but every so often, the following happens. We will either copy an oobject (for instance an iView) to another fold

  • Intel mac extreme - no go plugging computer directly into extreme

    I have a 24 inch Mac and yesterday bought an airport extreme. I want the computer to work plugged into the extreme, but when I do this it says that the Mac has a self assigned IP address and can not access the internet. I have updated all software an

  • Generating a content location request

    Hi, I'd like to generate a content location request from within a task sequence using my .net code. Assuming these are the correct classes; can anyone give me an exampe of using the ContentLocationRequest etc from the messaging SDK. Thanks. Simon Bur