Updating saved LBO image

Hi All!
I am facing a problem when updating an SUPBigBinary image in an LBO.
When I initially create the object in the LBO, the image is saved correctly and updated correctly,.. however, If I later wish to update the image with another image, it seems it is restricted to the original NSData length.
The new image saved is only visible halv-way.
Example:
To the left: Image taken with iPad, low-res
To the right: Larger image of a car
Notice the gray bottom of the right image.
Even worst, if I do not save an image just after I create the LBO item,... no image will be saved. The updating just seems to ignore the length.
My code:
WCR_LBO *wcr = [WCR_LBO getInstance];
[wcr setCOMPONENT_DESCR:[self getValueForRow:kTitleComponentDescription]];
[wcr setCUSTOMER_PRICE:[NSNumber numberWithFloat:[costString floatValue]]];//11
[wcr setCUSTOMER_ID:self.customerId.KUNNR];
if (self.viewMode == kWcrViewModeAdding)
    [wcr setCREATION_DATE:[NSDate date]];
    [wcr setWCR_LBO_ID:[NSString stringWithFormat:@"%i", [MHCDashboardUtil getAndSetNextDashboardLboId]]];
    [wcr create];
if (self.imageView.image)
    NSData *img1 = [UIImageJPEGRepresentation(self.imageView.image, 1) copy];
    SUPBigBinary *bbImg1 = wcr.PICTURE;
    [bbImg1 openForWrite:img1.length];
    [bbImg1 write:img1];
    [bbImg1 close];
    [wcr setPICTURE:bbImg1];
    [wcr save];
I have also tried it with setting openForWrite: to 0, same result.
What am I doing wrong?
Best regards,
Paul Peelen

I don't know how a mini behaves, but my 20G 4th gnereation iPod goes back to the update/reatore screen when it's finished.

Similar Messages

  • Help! Saving an image to stream and recreating it on client over network

    Hi,
    I have an application that uses JDK 1.1.8. I am trying to capture the UI screens of this application over network to a client (another Java app running on a PC). The client uses JDK 1.3.0. As AWT image is not serializable, I got code that converts UI screens to int[] and persist to client socket as objectoutputstream.writeObject and read the data on client side using ObjectInputStream.readObject() api. Then I am converting the int[] to an Image. Then saving the image as JPEG file using JPEG encoder codec of JDK 1.3.0.
    I found the image in black and white even though the UI screens are in color. I have the code below. I am sure JPEG encoder part is not doing that. I am missing something when recreating an image. Could be colormodel or the way I create an image on the client side. I am testing this code on a Win XP box with both server and client running on the same machine. In real scenario, the UI runs on an embedded system with pSOS with pretty limited flash space. I am giving below my code.
    I appreciate any help or pointers.
    Thanks
    Puri
         public static String getImageDataHeader(Image img, String sImageName)
             final String HEADER = "{0} {1}x{2} {3}";
             String params[] = {sImageName,
                                String.valueOf(img.getWidth(null)),
                                String.valueOf(img.getHeight(null)),
                                System.getProperty("os.name")
             return MessageFormat.format(HEADER, params);
         public static int[] convertImageToIntArray(Image img)
             if (img == null)
                 return null;
            int imgResult[] = null;
            try
                int nImgWidth = img.getWidth(null);
                int nImgHeight = img.getHeight(null);
                if (nImgWidth < 0 || nImgHeight < 0)
                    Trace.traceError("Image is not ready");
                    return null;
                Trace.traceInfo("Image size: " + nImgWidth + "x" + nImgHeight);
                imgResult = new int[nImgWidth*nImgHeight];
                PixelGrabber grabber = new PixelGrabber(img, 0, 0, nImgWidth, nImgHeight, imgResult, 0, nImgWidth);
                grabber.grabPixels();
                ColorModel model = grabber.getColorModel();
                if (null != model)
                    Trace.traceInfo("Color model is " + model);
                    int nRMask, nGMask, nBMask, nAMask;
                    nRMask = model.getRed(0xFFFFFFFF);
                    nGMask = model.getRed(0xFFFFFFFF);
                    nBMask = model.getRed(0xFFFFFFFF);
                    nAMask = model.getRed(0xFFFFFFFF);
                    Trace.traceInfo("The Red mask: " + Integer.toHexString(nRMask) + ", Green mask: " +
                                    Integer.toHexString(nGMask) + ", Blue mask: " +
                                    Integer.toHexString(nBMask) + ", Alpha mask: " +
                                    Integer.toHexString(nAMask));
                if ((grabber.getStatus() & ImageObserver.ABORT) != 0)
                    Trace.traceError("Unable to grab pixels from the image");
                    imgResult = null;
            catch(Throwable error)
                error.printStackTrace();
            return imgResult;
         public static Image convertIntArrayToImage(Component comp, int imgData[], int nWidth, int nHeight)
             if (imgData == null || imgData.length <= 0 || nWidth <= 0 || nHeight <= 0)
                 return null;
            //ColorModel cm = new DirectColorModel(32, 0xFF0000, 0xFF00, 0xFF, 0xFF000000);
            ColorModel cm = ColorModel.getRGBdefault();
            MemoryImageSource imgSource = new MemoryImageSource(nWidth, nHeight, cm, imgData, 0, nWidth);
            //MemoryImageSource imgSource = new MemoryImageSource(nWidth, nHeight, imgData, 0, nWidth);
            Image imgDummy = Toolkit.getDefaultToolkit().createImage(imgSource);
            Image imgResult = comp.createImage(nWidth, nHeight);
            Graphics gc = imgResult.getGraphics();
            if (null != gc)
                gc.drawImage(imgDummy, 0, 0, nWidth, nHeight, null);       
                gc.dispose();
                gc = null;       
             return imgResult;
         public static boolean saveImageToStream(OutputStream out, Image img, String sImageName)
             boolean bResult = true;
             try
                 ObjectOutputStream objOut = new ObjectOutputStream(out);
                int imageData[] = convertImageToIntArray(img);
                if (null != imageData)
                    // Now that our image is ready, write it to server
                    String sHeader = getImageDataHeader(img, sImageName);
                    objOut.writeObject(sHeader);
                    objOut.writeObject(imageData);
                    imageData = null;
                 else
                     bResult = false;
                objOut.flush();                
             catch(IOException error)
                 error.printStackTrace();
                 bResult = false;
             return bResult;
         public static Image readImageFromStream(InputStream in, Component comp, StringBuffer sbImageName)
             Image imgResult = null;
             try
                 ObjectInputStream objIn = new ObjectInputStream(in);
                 Object objData;
                 objData = objIn.readObject();
                 String sImageName, sSource;
                 int nWidth, nHeight;
                 if (objData instanceof String)
                     String sData = (String) objData;
                     int nIndex = sData.indexOf(' ');
                     sImageName = sData.substring(0, nIndex);
                     sData = sData.substring(nIndex+1);
                     nIndex = sData.indexOf('x');
                     nWidth = Math.atoi(sData.substring(0, nIndex));
                     sData = sData.substring(nIndex+1);
                     nIndex = sData.indexOf(' ');
                     nHeight = Math.atoi(sData.substring(0, nIndex));
                     sSource = sData.substring(nIndex+1);
                     Trace.traceInfo("Name: " + sImageName + ", Width: " + nWidth + ", Height: " + nHeight + ", Source: " + sSource);
                     objData = objIn.readObject();
                     if (objData instanceof int[])
                         int imgData[] = (int[]) objData;
                         imgResult = convertIntArrayToImage(comp, imgData, nWidth, nHeight);
                         sbImageName.setLength(0);
                         sbImageName.append(sImageName);
            catch(Exception error)
                error.printStackTrace();
             return imgResult;
         }   

    While testing more, I found that the client side is generating color UI screens if I use JDK 1.3 JVM for running the server (i.e the side that generates the img) without changing single line of code. But if I use JDK 1.1.8 JVM for the server, the client side is generating black and white versions (aka gray toned) of UI screens. So I added code to save int array that I got from PixelGrabber to a text file with 8 ints for each line in hex format. Generated these files on server side with JVM 1.1.8 and JVM 1.3. What I found is that the 1.1.8 pixel grabber is setting R,G,B components to same value where as 1.3 version is setting them to different values thus resulting in colored UI screens. I don't know why.

  • How to see all image types when saving an image without selecting "all files"every time

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/951766]]</blockquote>
    Hallo, and thank you for reading this.
    I am a person who saves a lot of images online and renames them in different folders in different names like B - 34 or G - 56. I have been working with firefox 10 for quite some time and it had a pretty handy bug (I guess) where I could save an image and firefox would just save the image in it's original type (JPEG,PNG etc) while "save as type" was empty.
    It also always has shown all the image types in the folder where I save the images (except for GIF) and that helpes me quite a lot by saving me the trouble of selecting "all files" every time I save or going to the folder to rename every image.
    Now this seems to be lacking in the newest firefox versions and my question is if I can set firefox to always show me all the image file types when saving an image, instead of only showing JPEG's when I try to save a JPEG.
    Thank you for your time.

    I suspect this is a Windows problem. I am surmising the FilePicker uses the Operating System or Desktop facilities. Does Windows 7 offer any other file categories like ''images'' ?
    I do not normally use Windows 7, but may the option depend upon the directory being an indexed one, I ask after finding this thread ''Bring File types tab back'' [http://www.windows7taskforce.com/view/819]
    This question is a duplicate of [/questions/951764]
    Normally I would lock the duplicate question, but in this instance I will leave it open as it is unanswered and someone may give a better reply.

  • When saving an image in PS CS 6, and going back to Lightroom 5. The original image and the edited image are at the end of the line up.

    I'm using a Mac, Lightroom 5 and Photoshop CS 6. I've started having an issue with the line up in Lightroom 5 after saving an image from PS CS 6. For some reason when I save the edited image form CS 6 it's taking the edited image and the original image and putting it at the end of the line up in Lightroom. If I take the edited image and move it to the right of the original it will put both of them back in the line up where they should be. How do I fix this. I've been looking in the menu for some kind of setting  with no luck.

    Change the sort order. View->Sort

  • Is there a way to "embed"/add Office updates to the image before deployment?

    Hi,
    in my TS I enabled preapp and postapp Updates
    So first windows patches are applied. Then computer reboots installs apps.
    I just enabled bunch of Office 2013 updates on WSUS. Office patches takes very long time.
    Is there a way to embed patches in MDT to save update time.
    Never used Packages node in MDT may this thing can help?
    How you deal with massive updates?
    Windows image can be updated, but Office for example that is installed after Windows deployment...
    Thx.
    &quot;When you hit a wrong note it's the next note that makes it good or bad&quot;. Miles Davis

    b.lange,
    no I do not install O2013 into the image. It is deployed as post OS install Application.
    I really don't see any significant gain of using individual patches in Updates or from WSUS.
    BTW, I am still confused about getting MS patches (KBs) beside by WSUS and creating msp from bunch of them.
    Could you please briefly describe where and how to download Office 2013 patches for Example from Feb 1 2014 until Sep 15 2014. And then create msp for placing to Updates folder.
    Is there something specific for Office 2013 patches that makes it easy to get as a package (one file)?
    Thanks.
    &quot;When you hit a wrong note it's the next note that makes it good or bad&quot;. Miles Davis

  • How to request - Updating an embedded image in a PDF using Actions but not all actions are recorded

    i am trying to create an Action in CS3 but some of my actions are not been recorded.
    What i want to do is run the Batch option on a folder with a 1,000 PDFs in it. The PDFs
    (which were created in Illustrator CS3) consist of a single page with a single embedded
    image at the foot of the page. I am trying to update that embedded image.
    The Actions i am trying to record are...
    1) Select the single image in the Links palette.
    2) Choose the "Relink.." option in the drop down menu of the Links palette.
    3) Navigate to the new image and select "Place".
    4) Save and close document.
    But the first two actions are not been recorded.
    How do i get around this problem ?
    Note: From trying this manually the new image seems to take on the horizontal and
    vertical scaling of the previous image which is what i want. But if i am going to have to
    do a script then that is a factor that may have to be incorporated into the script.
    Any help appreciated.

    Give this a trial… It does a save as which is much safer than overwriting… At least you still have your originals should I get something wrong…? I did test but only with 3 files…
    #target illustrator
    function replaceImage() {
              var i, doc, fileList, inFolder, outFolder, opts, pic, rep, rip, saveFile, uIL;
              inFolder = Folder.selectDialog( 'Please choose your Folder of AI PDFs…' );
              outFolder = Folder.selectDialog( 'Please choose a Folder to save AI PDFs in…' );
              pic = File.openDialog( 'Please choose your replacement Image…' );
              if ( inFolder != null && outFolder  != null && pic != null ) {
                        fileList = inFolder.getFiles( /\.pdf$/i );
                        if ( fileList.length > 0 ) {
                                  uIL = app.userInteractionLevel;
                                  app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
                                  for ( i = 0; i < fileList.length; i++ ) {
                                            doc = app.open( fileList[i] );
                                            rip = doc.rasterItems[0].position;
                                            rep = doc.placedItems.add();
                                            rep.file = pic;
                                            rep.move( doc.rasterItems[0], ElementPlacement.PLACEBEFORE )
                                            rep.position = rip;
                                            rep.resize( 31.414, 31.414, true, true, true, true, 100, Transformation.TOPLEFT );
                                            doc.rasterItems[0].remove();
                                            rep.embed();
                                            opts = new PDFSaveOptions();
                                            opts.pDFPreset = '[Illustrator Default]';
                                            saveFile = File( outFolder + '/' + doc.name );
                                            doc.saveAs( saveFile, opts );
                                            doc.close( SaveOptions.DONOTSAVECHANGES );
                                  app.userInteractionLevel = uIL;
                        } else {
                                  alert( 'This Folder contained NO Illustrator PDF files?' );
    replaceImage();

  • Update an embedded image in a PDF with Actions

    i am trying to create an Action in CS3 but some of my actions are not been recorded.
    What i want to do is run the Batch option on a folder with a 1,000 PDFs in it. The PDFs
    (which were created in Illustrator CS3) consist of a single page with a single embedded
    image at the foot of the page. I am trying to update that embedded image.
    The Actions i am trying to record are...
    1) Select the single image in the Links palette.
    2) Choose the "Relink.." option in the drop down menu of the Links palette.
    3) Navigate to the new image and select "Place".
    4) Save and close document.
    But the first two actions are not been recorded.
    How do i get around this problem ?
    Note: From trying this manually the new image seems to take on the horizontal and vertical  
    scaling of the previous image which is what i want, so that doesn't need to be a part of
    any solution.

    That will probably require a script, so ask in the pertinent forum.
    Mylenium

  • 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

  • File name used by plug-in for saving the image file.

    I have a program that creates a web page that has an object tag with a call to a program and that program delivers a PDF file.  When my users want to save that image the name of the image is a random name.  Is there any way to make the plug-in, Adobe, use the meta tag Title or any other infromation that my program can provide, as image (file)  name to be used for saving the image. (the initial suggested name)?  I really appreciate your help.

    One option is to rename the file after it's been exported using Windows File I/O API.

  • Saved an image as library and now all in iphoto images disappeared

    I was saving an image from email to iphoto, and somehow it was saved as my iphoto library. All of my photos are now gone, there were hundreds, and the one image I just saved is just there. Where are my photos??? Don't they get saved somewhere on my hard drive aside from being hosted iphoto. I have a MAC AIr and iPhoto '11.

    Rename it back.
    (110127)

  • 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.

  • An error occurred saving the images to the chosen file location

    I am trying to save the scans from my HP Officejet 6500.  I receive the following error message:
    An error occurred saving the images to the chosen file location.
    I have Win 7.
    I can scan and save if I choose to use the picture option but I can't use the feeder with the picture option.  It is only good if I have 1 page.

    I received this exact same message:
    an error occurred saving the images to the chosen file location.
    8,[(8,106,0)]
    I have not had the time to verify this, but I suspect the security settings on any other location you specify are not the same as those of the default.  i.e. C:\Users\%Username%\Documents\My Scans
    When I used the default location and base name the software provided, it worked.
    My guess is Microsoft and/or HP may have changed the security permissions for something in the path folders and the Scanning Software is therefore not permitted to write into the location you entered.

  • 10.4.7 update screws up image file associations

    Since installing the 10.4.7 update, all my image files now open in Preview as the default application, regardless of Type or Creator.
    I know that the file association of an individual can be changed via Get Info, however, I have 11,000+ image files in various formats as well as several thousand PDFs scattered across three hard drive, and do not want to waste several days tracking them all down and changing their file associations manually.
    I know that the "Change All" button in the Get Info panel is supposed to change all documents of a given type to the selected application, however, the "Change All" function seems to be broken because hitting "Change All" simply reverts everything to Preview.
    Deleting Preview does not solve the problem, as everything then defaults to Image Tricks; deleting Image Tricks simply defaults everything to Color Sync; deleting Color Sync defaults everything to Graphic Converter, which is fine for JPEGS, but I need Photoshop files to open in Photoshop, Illustrator files to open in Illustrator, etc.
    Is there a script or other simple way of changing the default application for various file types at the system level, i.e., so that .JPG always open in Graphic Converter, .PSD and .TIF in Photoshop, .PDF in Acrobat Reader, etc.?
    Thanks.
    2.0 GHz G5 Dual    

    Well, I had it happen to me again yesterday, i.e., all graphics files defaulting to Preview. I changed them back using the procedure I used earlier, but if this continues, it's going to be a MAJOR problem.
    Even after you selected, for
    example, Graphic Converter as the default application
    in the Open With pop-up menu, per step 3 in "Mac OS X 10.4 Help: Changing
    the application that opens a document."
    Unfortunately, no, not even after selecting Graphic Converter as the default app in the Open With menu.
    I think you
    mean Show Inspector, which is Command-Option-I, vs.
    Command-I for Get Info. The Inspector displays
    common info for a selection of objects, so you can
    change the default app for multiple files in one
    window.
    Hmm ... I get the same "Multiple Item Info" panel whether I hit Command-I and Command-Option-I if I have more than 10 files selected. In any case, I hit Command-I to bring up the Multiple Item Info panel.
    3. The anomalies you described are very strange. As
    a general check, run the Procedure specified in my
    "Resolving Disk, Permission, and Cache
    Corruption" FAQ. I'd recommend at least running
    Steps 1-3.
    I'll give it a go. Thanks!
    2.0 GHz G5 Dual    

  • 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 using a MacPro running OS 10.6.8. When saving an image in PS CC I no longer have a thumbnail of the image in my folder , just a generic PS symbol thumbprint. What do I do to get my image thumbnail back?

    I am using a MacPro running OS 10.6.8. When saving an image in PS CC I no longer have a thumbnail of the image in my folder , just a generic PS symbol thumbprint. What do I do to get my image thumbnail back?
    Adobe Creative Cloud

    Photoshop CC needs at least OSX 10.7-10.9
    You may be able to install and run it on 10.6.8, but as I understand it the rules for generating thumbnails has changed with Apple and CC writes them to suit the required OSX.
    Photoshop CS6 will always give you image thumbnails but CC and CC 2014 have had thumbnails generated differently for the required OSX.
    You will have to upgrade to 10.7,10.8, or 10.9
    My file saving preferences are set like this:

Maybe you are looking for

  • The logic is done, but my LAYOUT looks Awful!!! help?

    You guys have been great in helping me get through my little trivia game project and I believe I have ALL the logical processing in place, but the final and saddest MOST BLARING problem now is this DISGUSTING Layout. Here is the link: http://www.flic

  • Adobe illustrator runtime error R6025 pure virtual function call

    Buenas tardes amigos, Estoy trabajando sobre una versión Oficial de adobe Illustrator CS 6 con licencia, he realizado una extensión en Acción Script, luego de haber tenido numerosos problemas con la manipulación de imágenes de manera vectoriales en I

  • Can We generate source code from fmx and plx?

    Hi All, I got a problem with my machine hard disk issue. I have back up of only fmx and plx. Is there any way or any tool to generate fmb/pll's??? Thanks, Madhu

  • HT204032 I dont have power nap feature on my mac book pro...

    I dont have power nap feature on my mac book pro eventhough I am runnng the latest version of Mountain Lion and I have Retina display. How can I get it?

  • How to download Adobe DNG Converter?

    I've tried the links on the Adobe site but they take me only to an error message on both Firefox and Safari. I've got some JPGs I need to convert to DNG. (Hopefully this software will do the trick) Thanks for your help!