Saving image to a file?

Dear All,
public void createImage(float[] result, int width, int height){
          float[] pixels = new float[width*height];
        for(int i=0; i<pixels.length; i++){       
               //pixels[i] = (float)Math.round((1-result)*255);
               pixels[i] = (1-result[i])*255;
               //System.out.println(pixels[i]);
          DataBufferFloat dbuffer = new DataBufferFloat(pixels, width*height);
          SampleModel sampleModel = RasterFactory.createBandedSampleModel(DataBuffer.TYPE_FLOAT, width, height, 1);
     ColorModel colorModel = PlanarImage.createColorModel(sampleModel);
     Raster raster = RasterFactory.createWritableRaster(sampleModel, dbuffer, new Point(0,0));
     TiledImage tiledImage = new TiledImage(0, 0, width, height, 0, 0, sampleModel, colorModel);
     tiledImage.setData(raster);
     JAI.create("filestore", tiledImage, "image.jpg", "JPEG");
     //JAI.create("filestore", tiledImage, "image.bmp", "BMP");
     //JAI.create("filestore", tiledImage, "image.png", "PNG");
ImageIO.write(tiledImage, "jpg", new File("mask.jpg"));
catch(IOException ioe)
System.err.println("write: " + ioe.getMessage());
I create an image from the pixels data, and I display it in frame, it can display the image.
When I use the ImageIO.write(), it generates no error, but the image file cant be previewed using any image displayer program. The size of the file is 0 bytes. Why?
But when I want to save it using JAI.create(), it generate the following error:
Error: One factory fails for the operation "encode"
Occurs in: javax.media.jai.ThreadSafeOperationRegistry
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1682)
        at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeO
perationRegistry.java:481)
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
        at com.sun.media.jai.opimage.FileStoreRIF.create(FileStoreRIF.java:143)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1682)
        at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeO
perationRegistry.java:481)
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
        at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830)
        at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
        at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
        at javax.media.jai.JAI.createNS(JAI.java:1103)
        at javax.media.jai.JAI.create(JAI.java:977)
        at javax.media.jai.JAI.create(JAI.java:1625)
        at NN.createImage(NN.java:304)
        at NN.main(NN.java:121)
Caused by: java.lang.RuntimeException: Only 1, or 3-band byte data may be writte
n.
        at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.
java:148)
        at com.sun.media.jai.opimage.EncodeRIF.create(EncodeRIF.java:79)
        ... 25 more
Error: One factory fails for the operation "filestore"
Occurs in: javax.media.jai.ThreadSafeOperationRegistry
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1682)
        at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeO
perationRegistry.java:481)
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
        at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830)
        at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
        at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
        at javax.media.jai.JAI.createNS(JAI.java:1103)
        at javax.media.jai.JAI.create(JAI.java:977)
        at javax.media.jai.JAI.create(JAI.java:1625)
        at NN.createImage(NN.java:304)
        at NN.main(NN.java:121)
Caused by: javax.media.jai.util.ImagingException: All factories fail for the ope
ration "encode"
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1695)
        at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeO
perationRegistry.java:481)
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
        at com.sun.media.jai.opimage.FileStoreRIF.create(FileStoreRIF.java:143)
        ... 16 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1682)
        ... 19 more
Caused by: java.lang.RuntimeException: Only 1, or 3-band byte data may be writte
n.
        at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.
java:148)
        at com.sun.media.jai.opimage.EncodeRIF.create(EncodeRIF.java:79)
        ... 25 more
Exception in thread "main" javax.media.jai.util.ImagingException: All factories
fail for the operation "filestore"
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1695)
        at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeO
perationRegistry.java:481)
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
        at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830)
        at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
        at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
        at javax.media.jai.JAI.createNS(JAI.java:1103)
        at javax.media.jai.JAI.create(JAI.java:977)
        at javax.media.jai.JAI.create(JAI.java:1625)
        at NN.createImage(NN.java:304)
        at NN.main(NN.java:121)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1682)
        ... 10 more
Caused by: javax.media.jai.util.ImagingException: All factories fail for the ope
ration "encode"
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1695)
        at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeO
perationRegistry.java:481)
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
        at com.sun.media.jai.opimage.FileStoreRIF.create(FileStoreRIF.java:143)
        ... 16 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1682)
        ... 19 more
Caused by: java.lang.RuntimeException: Only 1, or 3-band byte data may be writte
n.
        at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.
java:148)
        at com.sun.media.jai.opimage.EncodeRIF.create(EncodeRIF.java:79)
        ... 25 more
Caused by:
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1682)
        at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeO
perationRegistry.java:481)
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
        at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830)
        at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
        at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
        at javax.media.jai.JAI.createNS(JAI.java:1103)
        at javax.media.jai.JAI.create(JAI.java:977)
        at javax.media.jai.JAI.create(JAI.java:1625)
        at NN.createImage(NN.java:304)
        at NN.main(NN.java:121)
Caused by: javax.media.jai.util.ImagingException: All factories fail for the ope
ration "encode"
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1695)
        at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeO
perationRegistry.java:481)
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
        at com.sun.media.jai.opimage.FileStoreRIF.create(FileStoreRIF.java:143)
        ... 16 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1682)
        ... 19 more
Caused by: java.lang.RuntimeException: Only 1, or 3-band byte data may be writte
n.
        at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.
java:148)
        at com.sun.media.jai.opimage.EncodeRIF.create(EncodeRIF.java:79)
        ... 25 moreAny idea? Ur voice will be appreciated. Raise ur voice!
Thanks>

When I use the ImageIO.write(), it generates no error, but the image >file cant be previewed using any image displayer program. The size of >the file is 0 bytes. Why?Are you sure that the file was closed?
I mean - file.close();

Similar Messages

  • Saving image from AVI file

    Hello,
    I have a piece of sofware using Buffer("bti") to stream live video (avi format). It could save video in avi format also. but now I have a problem that I need to use another buffer ("buf")to get a instant image from the live video and save it at disk. The code as follow:
    private void Save() {
         enableComponents(false);
         buttonStart.setLabel("Pause");
         buttonEnd.setEnabled(true);
         Buffer buf = grabberControl.grabFrame();
         if (bti == null || !buf.getFormat().equals(lastSnapFormat)) {
                   bti = new BufferToImage((VideoFormat)buf.getFormat());
                   lastSnapFormat = buf.getFormat();
         Graphics2D G2D;
    Image im = bti.createImage(buf);
    biSrc = new BufferedImage (im.getWidth(Spy_Eye.this),im.getHeight(Spy_Eye.this), BufferedImage.TYPE_INT_RGB);
    G2D = biSrc.createGraphics();
    G2D.drawImage(im, 0, 0, Spy_Eye.this);
    biDest = new BufferedImage(im.getWidth(Spy_Eye.this), im.getHeight(Spy_Eye.this), BufferedImage.TYPE_INT_RGB);
    if (im != null) {
    //Create a fileoutputstream.
    FileOutputStream fos;
    try{
    fos = new FileOutputStream("c:\\myJpeg.jpg");
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fos);
    encoder.encode(biSrc);
    fos.flush();
    fos.close();
    catch(FileNotFoundException e)
    {System.out.println(e);}
    catch(IOException ioe){System.out.println(ioe);}
    if (snapFrame == null){
    snapFrame = new SnapFrame(im);
    snapFrame.setVisible(true);
    snapFrame.setImage(im);
    snapFrame.setTitle("Image");
    processor.start();
         System.out.println("Image Capture");
    The processor.start() control the live stream and that code seems to be hold at "Buffer buf = grabberControl.grabFrame();" and no longer go.
    What should I do to improve such code. Please help. I am new to JAVA and JMF. If my description is not clear and anyone seem to be help need more information about those code, pls leave message what kind of information is needed.
    Thank you very much.
    fkli

    Hey there
    Actually I am very very intersted in capturing and watching live tv transmission on JMF player please help me in this my email address is: [email protected] I mean how can I watch tv on jmf player Thanks please do contact me again if you dont hav any thing to say because I have few more questions Thanks.

  • Why do the file extensions (.jpg .gif .png) no longer appear when I click on a previously saved image to use that image's file name (particularly important when saving a series of images using the same root name)?

    I save a lot of images using firefox, often times from a large batch or series of images. It used to be that I would click on a previously saved image and the entire file name including the file extension (i.e. image_example.jpg) would appear in the "save as" line. Now when I click on a previously saved file, the file name appears without the file extension (i.e. image_example). Which means I have to manually type .jpg every time. For a large collection of images that I am hoping to use the same root file name and then add chronological numbers at the end, this has become incredibly frustrating, especially as it is a previously unnecessary task.
    I am using a new Macbook Pro and maybe there's something Apple related to this...? It did not happen on my old PowerBook G4. I have file extensions turned on in System Preferences.
    It should be noted that I have searched high and low and have even gone into the Apple Genius Bar where they were just confused as I was and of course ended by urging me to use Safari (shocker!) as it has all kinds of new extensions and bells and whistles. I seriously feel alone on an island with this dumb, hard to google problem. Thanks so much for any help anyone out there might have.
    I mean: is this as simple as changing a setting in about:config?
    Your assistance is greatly appreciated.

    Thanks for your response Mylenium, however like I mentioned multiple times, I did change all of my trackpad/scrolling settings in system preferences.  And if I wanted to use a normal mouse (or a tablet), I would've gotten an iMac instead of a MacBook Pro.  I travel often and work all over the place, not always with access to a decently sized workspace that would be required for using a mouse or tablet.

  • TS3276 Having trouble sending jpeg images as attachments in Mac email.....they go thru as images and PC users can't see the SAVE or QUICK LOOK boxes that Mac mail has.  One friend scrolled over the image, right clicked on it and saved as a PNG file.

    Having trouble sending jpeg images as attachments in Mac email.....they go thru as images and PC users can't see the SAVE or QUICK LOOK boxes that Mac mail has.  One friend scrolled over the image, right clicked on it and saved as a PNG file.

    Apple Mail isn't going to change the format of any of your attachments. it isn't going to corrupt them either.
    Exchange is a transport protocol and server. The issue you describe is not related to Exchange.
    There are many different versions of Microsoft Outlook in use and they all have e-mail bugs. Different versions have different bugs. Some Apple Mail hack to get around a bug in Outlook 2003 may cause the same message to be problematic in Outlook 2000. Fix them both and another issue will cause trouble in Outlook 2007. You can't fix this. Apple can't fix this. Microsoft can and has but that is irrelevant if your recipients are using older versions.
    One specific problem is that Apple Mail always sends image attachments inline, as images, not as iconized files. You can change this with Attachment Tamer. Just be aware that use of this software will break other things such as Stationery. E-mail is just a disaster. To date, no one outside of Apple has ever implemented the e-mail standards from 1993. Apple has continually changed its e-mail software to be more compatible with the de-facto standards that Netscape and Microsoft have unilaterally defined and people documented as "standards" after the fact. The e-mail messages that Apple Mail sends are 100% correct and do not violate any of the original standards from 1993 or the Microsoft/Netscape modifications. The problem is entirely bugs and limitations in various versions of Outlook.

  • When I try to open a saved image with the "htm" file extension all I get is a page of gibberish text.

    I have the new Snow Leopard system on my iMac. I saved several images from an art site. The file extension on each image is "htm". when I try to open each image all I get is gibberish tpye text.
    Can convert these "images" to jpeg files so I can view and edit them?
    thanks

    If the images have a .htm(l) file extension then you need to rename the files and give them an image file extension like .jpg<br />
    That should be sufficient to make programs recognize them as images.

  • Black background of saved image file.

    Hello All,
    My code is set up to create an image then save the image into a file in JPEG format. Everything works well except the background of the saved image is balck. How can I get a white background on the saved file?
    I have posted my code below. I have allocated 10 duke dollars for the person solves who this? Thank You!!!!
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import com.sun.image.codec.jpeg.*;
    import java.io.*;
    import java.awt.image.BufferedImage;
    public class Test2 extends JApplet {
    public void init() {
    //Initialize drawing colors
    setBackground(Color.white);
    setForeground(Color.black);
    public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    Dimension d = getSize();
    int gridWidth = d.width / 6;
    int gridHeight = d.height / 2;
    // fill Rectangle2D.Double (red)
    g2.setPaint(Color.red);
    g2.fill(new Rectangle2D.Double(100, 100, 100, 100));
    g2.setPaint(Color.black);
    g2.drawString("My Rectangle", 125, 85);
    public static void main(String s[]) {
    JFrame f = new JFrame("Test2");
    f.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}
    JApplet applet = new Test2();
    f.getContentPane().add("Center", applet);
    applet.init();
    f.pack();
    f.setSize(new Dimension(400,300));
    f.show();
    saveAsJPEG(applet, 1.0F, "myJPEG.jpg");
         public static void saveAsJPEG(Component component, float quality, String filename)     {
              try          {
                   Dimension d = component.getSize();
                   BufferedImage bimage = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_RGB);
                   component.paint(bimage.createGraphics());
                   Graphics2D g = (Graphics2D)bimage.getGraphics();
                   g.setPaint(Color.white);
                   if(!filename.endsWith(".jpg"))
                        filename += ".jpg";
                   OutputStream out = new FileOutputStream(filename);
                   JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
                   // Create JPEG encoder
                   JPEGEncodeParam jpegParams = encoder.getDefaultJPEGEncodeParam(bimage);
                   jpegParams.setQuality(quality, false);
                   // Set quality to (quality*100)% for JPEG
                   encoder.setJPEGEncodeParam(jpegParams);
                   encoder.encode(bimage);
                   // Encode image to JPEG and send to browser
                   out.close();
              catch (Exception e)          {
                   System.out.println(e);
    }

    I've added 2 lines to your paint, it works now.
    public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    Dimension d = getSize();
    int gridWidth = d.width / 6;
    int gridHeight = d.height / 2;
    // make a white background
    g2.setPaint(Color.white);
    g2.fill(new Rectangle2D.Double(0, 0, d.width, d.height));
    // fill Rectangle2D.Double (red)
    g2.setPaint(Color.red);
    g2.fill(new Rectangle2D.Double(100, 100, 100, 100));
    g2.setPaint(Color.black);
    g2.drawString("My Rectangle", 125, 85);
    }

  • Saving an image and data file

    Am am current developing a program similar to the one below using an elvis module.
    I am trying to save am image of the graph but, the save image window keeps popping up because of the loop.
    I just want to be able to click a button and then save the image to a file without the save window popping up every time. 
    Attachments:
    conor.vi ‏57 KB

    Hi cdwyer,
    In your second example's block diagram, you need to have the save button terminal and the associated case structure within your main loop, otherwise the button/case structure is only read/executed the one time.
    An additional tip: When saving "computer graphics", like LabVIEW panels or diagrams, it's nearly always better to save them using the PNG format. PNG format is both compressed (small file sizes) and yet also "lossless compression" (no image degradation) - also it's usually preferable to use true colour (24 bit colour depth).
    JPEG file type is a "lossy" type of compression that is designed for photographics - it will cause blurring and colour distortions when used with computer graphics.
    Mark.
    P.S. Worth a few star ratings?
    Message Edited by Mark H on 02-02-2006 12:11 PM
    Attachments:
    example2 modified.vi ‏72 KB

  • When saving image i want that firefox auto change the file name if same name exists like google chrome etc. if there is any option pl let me know.

    when saving image i want that firefox auto change the file name if same name exists, like google chrome does this. if there is any option pl let me know.

    this saves images, i just want to save single image, and wants while saving image, it auto changes the name if find similar name of file in the folder. chromium and maxthod does this

  • Saving image to a folder not working on azure

    I am saving image
    files to a folder in my application and saving its path in database . Image uploads working fine when I am running locally
    and its path is also storing.When I deployed it on azure it
    gives an error that " An error occurred while processing your request ". I have two tables in my database . First one where text is saved is working fine on azure but image upload thrown this error.
    I am using this code
    to upload
    image and its works fine when I am running locally. Need help ?

    Hi,
    Have you made any progress ?
    May I ask what application is it that you are running ? You mentioned that it works locally but not when deploying to Azure. Have you checked the connections strings?
    If you are still having any difficulty in understanding the code, perhaps you could post it on the below blog.
    http://blogs.msdn.com/b/onecode/archive/2014/08/28/sample-of-aug-28-how-to-store-the-images-in-sql-azure.aspx
    Regards,
    Mekh.

  • How do I add multiple images into one file?

    I'm sure this is something that's been covered in another post (or even in the help portal) but I think my wording in my search terms are not correct or... I don't know, because I just can't find what I'm looking for.
    I want to know how to add multiple images into one file/one image, both horizontally and/or vertically. To give you an idea of what I mean, check out :
    http://www.best10apps.com/apps/comic-story,531596060.html
    If you scroll down, you'll see a heading entitled : Screenshots of Comic Story. Notice how there's 3 pictures (divided by borders). 2 of those pictures are side by side, and 1 of them is below the first 2 pictures.
    I want to know how to add different pictures/images and put them into one picture.

    One way is to create template PSD files and populate them with your images using Photoshops scripts.
    Photo Collage Toolkit UPDATED June 12, added Picture Package Support via PasteImageRoll and BatchPicturePackage scripts.
    The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.
    There are eleven scripts in this package they provide the following functions:
    TestCollageTemplate.jsx - Used to test a Photo Collage Template while you are making it with Photoshop.
    CollageTemplateBuilder.jsx - Can build Templates compatible with this toolkit's scripts.
    LayerToAlphaChan.jsx - Used to convert a Prototype Image Layer stack into a template document.
    InteractivePopulateCollage.jsx - Used to interactively populate Any Photo Collage template. Offers most user control inserting pictures and text.
    ReplaceCollageImage.jsx - use to replace a populated collage image Smart Object layer with an other image correctly resized and positioned.
    ChangeTextSize.jsx - This script can be used to change Image stamps text size when the size used by the populating did not work well.
    PopulateCollageTemplate.jsx - Used to Automatically populate a Photo Collage template and leave the populated copy open in Photoshop.
    BatchOneImageCollage.jsx - Used to Automatically Batch Populate Collage templates that only have one image inserted. The Collage or Image may be stamped with text.
    BatchMultiImageCollage.jsx - Used to Automatically Batch Populate Any Photo Collage template with images in a source image folder. Easier to use than the interactive script. Saved collages can be tweaked.
    BatchPicturePackage.jsx - Used to Automatically Batch Populate Any Photo Collage template with an image in a source image folder
    PasteImageRoll.jsx - Paste Images into a document to be print on roll paper.
    Documentation and Examples

  • OutOf Memory Error while saving image of canvas

    Hi,
    I am facing a weired problem while saving the image of the graphics in Canvas. It's giving me OutOfMemory error. Here is snippet of code:
    if(cmd.equals(C.ACTION_SAVE)){
                try {
                    FileDialog fd = new FileDialog(frame, "Save ProcessInstance as JPEG", FileDialog.SAVE);
                    fd.setFile(processInstance.getProcessDefinition().getName() +processInstance.getProcessOwner() +processInstance.getProcessOwnerId() +".jpeg");
                    fd.show();
                    String name = fd.getDirectory()+fd.getFile();
                        int w = canvas.getWidth(), h = canvas.getHeight();
                        BufferedImage image = new BufferedImage(w, h,
                                BufferedImage.TYPE_INT_RGB);
                        Graphics2D g2 = image.createGraphics();
                        canvas.paint(g2);
                        g2.dispose();
                        ImageIO.write(image, "jpeg", new File(name));
                    } catch (IOException e) {
                        System.err.println(e);
                    }

    Hi,
    I tried to run garbage collector for the same and now its working fine. I want to know is there any drawback of using this approach. I am new to java and waiting for ur expert comments. I added following lines in the above code just below ImageIO.write(image, "jpeg", new File(name));:
             image = null;
                        Runtime r = Runtime.getRuntime();
                        r.gc();

  • Saving image using mobile into sap R/3

    We are using sap mobile platform version 2.3 and our client requirement is to save images using mobile apps.
    We already saved images in mime repository but for this we have to required client modifiable , but due  to security reason we can't do this.
    Please Help.

    Hi Nilesh ,
      I had a scenario to attach image to pr05 transaction from mobile, so that when click view attachment button in pr05 i can see the image . My code is based on that .
    it is the function module with import parameter base64 string and filename ,last three letters of the file name proceeding the . is the extension
    in your case you need to create custom object type instead of  BUS2089 .
    Do research regarding that ..
    -->Local Workare declaration.
       DATA : ls_fol_id   TYPE soodk,
              ls_obj_id   TYPE soodk,
              ls_obj_data TYPE sood1,
              ls_content  TYPE soli,
              ls_folmem_k TYPE sofmk,
              ls_note     TYPE borident,
              ls_object   TYPE borident.
    **--> Local internal table declaration.
       DATA : lt_content   TYPE STANDARD TABLE OF soli,
              lt_url_tab   TYPE STANDARD TABLE OF so_url,
              lt_objhead   TYPE STANDARD TABLE OF soli.
    **--> Local variable declaration.
       DATA : lv_filename            TYPE string,
              lv_file_name_with_path TYPE chkfile,
              lv_stripped_name       TYPE string,
              lv_name                TYPE char30,
              lv_url_tab_size        TYPE sytabix,
              lv_ep_note             TYPE borident-objkey.
       ls_object-objtype = 'BUS2089'.
       ls_object-objkey  = '001095510000020022'.
       ls_obj_data-objdes = I_FILE_NAME.
       ls_obj_data-file_ext = I_FILE_EXT.
       CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
         EXPORTING
           buffer     = I_FILE
         TABLES
           binary_tab = lt_content.
       CALL FUNCTION 'SO_CONVERT_CONTENTS_BIN'
         EXPORTING
           it_contents_bin = lt_content[]
         IMPORTING
           et_contents_bin = lt_content[].
    **--> Getting folder ID to save data
       CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
         EXPORTING
           region                = 'B'
         IMPORTING
           folder_id             = ls_fol_id
         EXCEPTIONS
           communication_failure = 1
           owner_not_exist       = 2
           system_failure        = 3
           x_error               = 4
           OTHERS                = 5.
       IF sy-subrc = 0.
         ls_obj_data-objsns = 'O'.
         ls_obj_data-objla = sy-langu.
         ls_obj_data-objlen = LINES( lt_content ) * 255.
         CLEAR ls_content.
         CONCATENATE '&SO_FILENAME=' I_FILE_NAME '.' I_FILE_EXT INTO ls_content.
         APPEND ls_content TO lt_objhead.
    **-->To Create an Object and Move to a Folder
         CALL FUNCTION 'SO_OBJECT_INSERT'
           EXPORTING
             folder_id                  = ls_fol_id
             object_hd_change           = ls_obj_data
             object_type                = 'EXT'
           IMPORTING
             object_id                  = ls_obj_id
           TABLES
             objcont                    = lt_content
             objhead                    = lt_objhead
           EXCEPTIONS
             active_user_not_exist      = 1
             communication_failure      = 2
             component_not_available    = 3
             dl_name_exist              = 4
             folder_not_exist           = 5
             folder_no_authorization    = 6
             object_type_not_exist      = 7
             operation_no_authorization = 8
             owner_not_exist            = 9
             parameter_error            = 10
             substitute_not_active      = 11
             substitute_not_defined     = 12
             system_failure             = 13
             x_error                    = 14
             OTHERS                     = 15.
         IF sy-subrc = 0 AND ls_object-objkey IS NOT INITIAL.
    *            COMMIT WORK AND WAIT.
           ls_folmem_k-foltp = ls_fol_id-objtp.
           ls_folmem_k-folyr = ls_fol_id-objyr.
           ls_folmem_k-folno = ls_fol_id-objno.
           ls_folmem_k-doctp = ls_obj_id-objtp.
           ls_folmem_k-docyr = ls_obj_id-objyr.
           ls_folmem_k-docno = ls_obj_id-objno.
           lv_ep_note = ls_folmem_k.
           ls_note-objtype = 'MESSAGE'.
           ls_note-objkey = lv_ep_note.
    **-->Link the object ID to trip No.
           CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
             EXPORTING
               obj_rolea      = ls_object
               obj_roleb      = ls_note
               relationtype   = 'ATTA'
             EXCEPTIONS
               no_model       = 1
               internal_error = 2
               unknown        = 3
               OTHERS         = 4.
           IF sy-subrc = 0.
    *            COMMIT WORK AND WAIT.
           ENDIF.
         ENDIF.   " SO_OBJECT_INSERT
       ENDIF.       " SO_FOLDER_ROOT_ID_GET
    ENDFUNCTION.

  • Saving image in ms sql database.

    Hi all, i have a problem saving image in the database.i used
    request.getParameter("imagename"), to get the content of the textfield in the html file but the problem is that it omits the filepath and gives me just the image name and that gives me an error.. Pls help me

    Your actual problem is less or more web browser related. The right way is that the browser should only send the filename, but a certain widely used browser developed by a team in Redmond would send the full file path as it is at the client side, which is completely wrong.
    The bigger picture what you're trying to achieve, uploading a file from the client to the server, shouldn't be done that way, simply because this isn't going to work at all if the client runs at a completely different machine on the other side of the network than where the server runs. You need to send the actual file contents to the server. Just set the form's enctype to multipart/form-data and parse the body of the request to get the actual file contents. To ease the work I recommend you to use Apache Commons FileUpload API for parsing the multipart/form-data request. Go to their homepage and check out the 'User guide' and 'Frequently Asked Questions' how to use it and for some tricks.

  • Image Processor Jpg Files Cause LR to Stop Working

    Photoshop CS3 and Lightroom 1.4.1
    Vista Ultimate 64 / 8 Gig Ram / Lots of Hard Drive space on Scratch Drive
    nVidia 8800 GTS w/640 MB Ram
    Image files processed in Photoshop
    Exported via: File > Scripts > Image Processor (IP)
    IP settings are default except the jpg output is set to 12/max
    From the same PSD file, no modifications in PS
    One file will cause LR to crash ("A problem caused the program to stop working correctly) the next does not.
    Both jpg files open and display without a problem in...
    - Photoshop
    - Adobe Camera Raw
    - Microsoft Office Picture Viewer
    - Apple Quicktime Picture Viewer
    - Windows Explorer (thumbnails)
    I have saved two otherwise identical files, one crashes LR every time, the other opens in LR fine, every time.
    This has been occurring in about 3 out of every 100 files saved via IP.
    The next time LR is opened it crashes again if the 'bad' file is not renamed or deleted due to the automatic file updating process.
    Trying to import 100 files requires importing them one at a time when this happens because there is nothing to indicate which file cause LR to break during the batch import.
    If Adobe Tech Support would like the two 'identical' files they can email me and I'll send them along.

    *push*

  • Sending Downsized Images to Zip File Problems

    I use Adobe Elements 5.0 and have been uploading images to the organizer for a couple of years without problems, until just recently.  Here is how the process used to work.  When images are uploaded they are saved to a new file folder under C drive/ Public Photos/ specific folder with date and subject matter;  I fix the images in adobe then go to the specific folder and create a subfolder within that folder called "downsized".  I then use Adobe to "process multiple files" and downsize for purposes of sending to Pbase. Once the files have been downsized the images end up in the specifc folder, inside the downsized subfolder.  I then rt click and select "send to" 'compressed (zip) folder'.  From there I would open Pbase and upload the zipped folder to a new gallery.
    Recently everything has been fine until I get to the send to zip folder.  Instead of sending to the familiar yellow zip folder it is being sent to the adobe photoshop editor in the form of the adobe icon.  I click on that and it promts me for filename, width, height, resolution and color mode.  I am unable to upload this zipped file version to Pbase.  Previously, when things were operating correctly, I would have a folder, with a subfolder under that called downsized.  Within the downsized folder would be the zipped file for sending to Pbase.  Something has happened recently so that I am ending up with a folder, a subfolder called downsized a sub 'folder' under that which is the adobe elements icon and a downsized file under that which is a copy of the downzied photos in the first downsized file.  In checking out all of my 100 or so folders all of them have been 'converted" to the same organization pattern.  What has happened and how do I fix the problem so that I can send the downsized folder to a zip file for importing to Pbase?  Thank you. 

    You should realize I am just making wild guesses at your problem. And I am assuming you actually have a Microsoft Word document that you are sending. If you do, then following menu options "Insert, Picture, From File..." should work. But if you are just writing out HTML and telling the browser it's actually a Word document, I have no idea.

Maybe you are looking for

  • How much does a license ADF cost?

    Hi, i want to develop a commercial application with Oracle ADF (JDeveloper) on a Tomcat Web Server. I'm using an oralce database, which is already licensed. Which products does I have to license and how much does it cost? Thanks a lot Wolle

  • CCMS Configuration - Central Monitoring and Email Alerts with Solution Mgr

    I am trying to configure my CCMS alerts on my satellite systems to be linked into the Solution manager system (acting as the CEN monitoring node). If I have already setup my RZ20 alerts, is there a way I can just link these into Solution Manager. Tha

  • Converting Nokia N95 video for editing in Final Cut Pro?

    I have some .mpeg4 videos shot with a Nokia N95 mobile phone that I want to edit in Final Cut Pro. I read everywhere that .mpeg4 is not an "editing format". I want to use Quicktime Pro (or Mpeg Streamclip) to convert the footage to something I can us

  • Missing Sequence Presets in Premiere Pro CC

    I've recently installed Premiere Pro CC and there are loads of presets missing on the new sequences dialogue box. Beside, I can't open and preview MP4 file which works fine in CS6. My operating system is Windows 7. I've tried these two methods and di

  • Average system statistics

    Hi all, I have a package which captures system statistics into a user specified table using the usual method: --1. Create user defined stats table to store stats DBMS_STATS.CREATE_STAT_TABLE (ownanme => 'STAT_ADM' ,stattab=>'STAT_LOG' ,tblspace=>'STA