PNG error in createEncodedImage

Hey. In the code below, I try to read a PNG file system and put it in an EncodedImage to stagger on 4.6 phones. The 2nd last line of code produces the error/stacktrace illustrated in the screenshot. Advice on what Miss me?  TKS, J.


    private static Bitmap LoadBitmap(String uri) {

        InputStream in = null;
        FileConnection filecon = null;
        String exceptionText = null;
        byte[] bitmapBytes = new byte[1000000];
        boolean fileExists = false;
        int numBytes = 0;
        int newNumBytes = 0;

        try {
            filecon = (FileConnection) Connector.open(uri, Connector.READ);

            if (filecon.exists()) {

                in = filecon.openInputStream();

                bitmapBytes = IOUtilities.streamToBytes(in);
                in.close();        

                if (bitmapBytes != null) {
                    if (bitmapBytes.length > 0)
                        fileExists = true;
                }

            }
        }
        catch (Exception e) {
                    String logMessage = e.getMessage();
                    if ( EventLogger.logEvent( 0x4c9d3452d87922f2L, logMessage.getBytes(), EventLogger.ALWAYS_LOG ) ) {
                        System.out.println("Log Successful!");
                    }
        }

        Bitmap bm = null;

        if (fileExists) {

            String imageExtension = uri.substring(uri.length() - 4); // e.g. .png or .jpg or .gif

            if (imageExtension.equals(".png")) {

                //bm = Bitmap.createBitmapFromPNG(bitmapBytes, 0, -1);
                EncodedImage image = EncodedImage.createEncodedImage(bitmapBytes, 0, numBytes, "image/png");
                bm = image.getBitmap();

I do not see where you define numBytes one value other than zero.

Tags: BlackBerry Developers

Similar Questions

  • Rendering to PNG error

    A problem arose after the passage according to effect CC 2014; grabbing a frame as a PNG file fails with this error message: "support CEAP Plugin PNGIO: library PNGIO error: known profile sRGB incorrect (5027: 12).

    So, what the devil is that supposed to mean and how to fix it?

    Thank you

    In the output module settings, go to the "color management" tab and check "preserve RGB.

  • Export PNG error:

    I want to export my *.indd in PNG. I tried the following code:

    function ExportPNG("/c/test)
    {
        try
        {
            app.activeDocument.exportFile(ExportFormat.PNG_FORMAT, File(filePath + '.png'));
        }
        catch(e)
        {
            alert(e);
        }
    }
    

    However, I get the following error:

    Error: The specified object does not support the desired export format.

    How can I fix?

    Fix. myObj is an instance of pageItems (in the plural), and you can not export those. You probably meant it

    myGroup.exportFile(ExportFormat.PNG_FORMAT, File(filePath + '.png'));
    myGroup.ungroup();
    

    but you must keep in mind that Javascript is not good to do what you really want to do, he can't do what you tell him...

  • Firefox 38.0.1 get up errors in the console with JS and CSS htaccess enabled compression

    Hello

    I worked on improving the performance on my Wordpress site, one of the things I've done, I switched to a dynamic delivery of CSS and JS files (so they are compressed by PHP), which has worked very well for the performance tests.

    Now, I ALSO added it to the .htaccess in my JS and CSS (wp - TTC) file on a wordpress site:

    <filesMatch "\.(js|css)$">
    Header set Content-Encoding x-deflate
    # Header set Content-Encoding compress
    # Header set Content-Encoding x-gzip
    </filesMatch>

    to compress JS and CSS files. It works fine on IE, CSS, Android and speed, but the wrong tests, is that the site seems broken in Firefox 38.0.1, it can not load my menus and revolution Slider (image carousel).

    main error seems to be jQuery is not defined...

    Here's a montage that shows thedl.dropboxusercontent.com/u/28979877/FirefoxErrorsCollage.png errors...https://

    is there anything else that I could change in this .htaccess syntax that make each happy browser?

    any thoughts?

    Thank you very much
    Gabrio

    Hello

    I have disabled the function of .htaccess for now...

    We discovered (with assistance from Frank Autoptimize, I can TOTALLY recommend also, it's great!) said that he could not work because that makes the output is compressed, but not actually... compression. If firefox is right, others wrong.

    This should be used, IF the server supports it (ours is not because it is just shared):

    < IfModule mod_deflate.c >

            <FilesMatch "\.(js|css)$">
            SetOutputFilter DEFLATE
        </FilesMatch>
    </IfModule>
    

    so for now, I removed the .htaccess to compress JS and CSS files and FF is happy now.

    Thank you
    Gabrio

  • x 230 Tap simple script error

    Whenever I click on the tile "Get more Apps" in the right row, I get a Script error with the following message: [IMG][line] http://i.imgur.com/Oc3su57.png error: access denied for: http://shop.lenovo.com/ISS_Static/css/themes/ow/ie-css3.htc the only way I can get rid of the infinitely popping up error window is to kill a Simple tap in the Task Manager. Any suggestions?

    My advice is to uninstall SimpleTap from the control panel "programs and features".  Lenovo has retired it.  The store is dead.  Sorry for the inconvenience.

  • Validation for the Packaging icon error

    I get the following error when debug my app in same Burrito so I don't Icon.png in my package:

    "Error in the application of packaging:

    The file with the Icon.png path may not be packaged, unless the descriptor field application.icon.image57x57 is set to Icon.png
    "Error: posting AIR failed.

    BlackBerry - tablet.xml foobar - app.xml contain application.icon.image57x57.

    Where can I specify that override this validation error?

    Update: I have not found a soultion to this reconstructed so my application instead.

  • Fatal error Workstation 10.0.0.5

    The host is Linux Mint 17 64-bit

    VM is Windows 7 Pro 64-bit

    When I stopped the VM, it throws a fatal error (vmx)

    Attached are log, vmx, png error dialog. See a few other posts with this, but so far, no resolution.

    Lou

    Problem disappeared.

    After doing this about 6 times in a row, he stopped.

    Gremlins?

  • Size of the Universal Image of SplashScreen

    Hello

    Copy of the image I want to use for my splashscreen gives me an error IE

    Gidi2.PNG: error! 907: given the icon are too big: 121691 bytes

    What is the size of the image that I have to use it please

    Nice look

    I would recommend that you have just a single image which is 240 * 240.  It fits on all screens.  You will need to 'Center' of it.  There are a variety of ways to do this, and you should search the forum because this question has been answered elsewhere.  In your search, you should inspect the background of the Manager you put this in French - that's how you get the black background. I mind not resize to suit any specific device, OK is displayed throughout.  If however, you want to resize, and then I would scale to stay square but to adapt to the device width or the height of the unit, whichever is the smaller.  You can find that using Display.getHeight () and getWidth(), search the Forum again for the number of entries that talk about scaling of images.

    Finally, I think that you find it useful:

    http://supportforums.BlackBerry.com/T5/Java-development/MainScreen-explained/Ta-p/606644

    Good luck.

  • Homegroup (Win7)

    Hello, this is my first post.

    I have a problem in homegroup.  I'm running Win 7 64 on this Pavilion dv7 notebook, ser. No. CNF0152LJR. I have set up a group of houses to a PC with Win7 32 bit. The PC's Ethernet - wired & the dv7 is wireless, an ASUS DSL - N11 router. For months, it worked well, but I can't access the homegroup. My HP C5380 printer is connected to the dv7. I used the tools of administration - Services - Pera Nsoul Rresolution Protocol /Peer Networking Grouping/peer Networking Identity Manager, to check both computers. The PC shows all 3 "Started" Services, but I get the following error trying to start them in the laptop: PNRP: '80630801:0 x 80630801 x 0' - PNG: error: 1068.

    I restarted NIBPM, but can not restart services PNRP & PNG . Message bed "Is unable to restart the Windows Service", although he is trying to do but stops. I don't understand the error messages, or their application to resolve the problem. Help! Please?

    Bob W.

    Hi Bob,

    On the laptop, try the following to see if that helps the issue.

    On the Start Menu, open the control panel and open Folder Options.  Click on the view tab, check the radio button titled "Show hidden files, folders and drives" and out the box "Hide extensions of known file types".  Click on apply to apply these changes.

    Then go to C\Windows\ServiceProfiles\LocalService\AppData\Roaming to Local disk and open the PeerNetworking folder.  Inside, you should see a file called idstore.sst.  Delete this file.  Close this window and return to Folder Options then re - hide hidden files folders and drives and extensions of known file types.

    Restart the PC and let Windows load completely.

    Now, check if the following services appear as shown below, and if they are not, if you can set them up now.

    Peer Networking Grouping this should see the service type as Manual and the service is expected to show that started.

    HomeGroup Provider should show as Manual startup type, and the service should show as started.

    Peer name resolution should see commissioning type as Manual and the service is expected to show that started.

    Peer Networking Identity Manager should display type as Manual startup and service should show as started.

    If they are all able to start, or have already started, see if Homegroup now works properly.

    Best wishes

    DP - K

  • [Build ripple failed] The resource name is not valid

    Hello guys,.

    I have problems with my application using ripple of packaging. It continues to produce [Oh Snap! [Build request failed with the message: invalid application [ERROR] (Archives) - name of the resource are not valid (img/[email protected])] error.

    I'm guessing a reoccurrence of an old bug as tneil well said in this post , so I used the latest version of the SDK (BlackBerry WebWorks SDK 2.2.0.15), but the error persists.

    Please note that I used Ripple many times before with the "-" on the names of file deleted on my mind, which is probably the reason why I've not encountered this earlier but it's just that I'm importing pre-made images with strict naming conventions (with a "-") so I can't go and rename them.

    Here is a screenshot of ripple.

    Any help would be appreciated.

    There are special characters that are not supported in the names of embedded resources for an application running on the BlackBerry Smartphone platform.

    I think that is one of these characters not supported

  • Try to add an application icon in the burrito

    OK, so im trying to add an icon in the burrito, and when I change the XML file to have

    Icon.PNG

    I get this error:

    The file with the Icon.png path may not be packaged, unless the descriptor field application.icon.image57x57 is the Icon.png Error value: validation of AIR omitted

    Don't know exactly how to set the icon of the application in the fllash burrito generator. Oh, and now I've changed the code back to until I edited it and I still have this error.

    Any help?

    Thank you!

    Alex

    If you really know the error to go away, this thread would recommend rebuild your application. Not ideal, but if you're willing to spend per burrito you.

    http://supportforums.BlackBerry.com/T5/Tablet-OS-SDK-for-Adobe-Air/icon-packaging-validation-error/m...

    Another tip is to try to name your icon blackberry-tablets - icon.png. I know that others have had success with call it something else, but mine works with this naming convention.

    You can always try packing through the command line?

  • Recently, a problem began when I cut-and - paste into a new E-Mail. Sending error. Message indicates error attaching "call_skype_logo.png." File not found

    The message send failed.
    There was an error of fixing call_skype_logo.png. Please check if you have access to the file.

    I did not indicate the Ctrl + V, I suggested that Ctrl + Shift + V, and if I didn't, it was a mistake.

    What is happening is that information from the copy of the web page contains an image that is not visible and can be invoked with javascript. Thunderbird is sticky to ok, but when you try send this image (common, through the internet, as Skype image that appears with facebook, twitter etc. can not be found. I don't really know what code complex your copy and paste and I doubt you do one. CTRL + SHIFT + V just glue the text without frills. Nothing else and should have no problem at all because the reference to the image should be absent.

  • Video rendering error 10008 when using PNG on clip

    As soon as I add a PNG above a video clip, it fails when I try to make. It gives the error code 10008 is. I tried several png. If you add in front of a video, it will work fine. As soon as you try to use the same image over the video (using a logo for example), it fails as stated above. This means that I'm not able to add a logo watermark to videos.

    Please notify.

    Thank you.

    A simple alternative is to put your watermark on a green or blue background as a pdf file, then use the green/blue screen installation.

    I remember reports that contain PNG used to ensure transparency in photo - images to have exactly the same dimensions of the pixel as the setting of the project, for example, 1920 x 1080 full HD.  However, if this were not the case, I thought they still made, but have been converted to PDF, if transparency does not.

    Geoff.

  • EVTA Plugin PNGIO support error - unable to decode the PNG (5027: 12)

    Is that what someone has encountered this error when importing png? I am aware that it may occur when a png file is corrupted, but what interests me, doing so is the capture of the error if it occurs to invite the user to correct and re - import problem.

    A discussion on the blocking of the dialogs here:

    https://forums.Adobe.com/thread/1717334

    Doesn't seem to help scientifantastic import dialog problem, but you can certainly see if it works for your question.

  • Bridge gives error only when previewing a .png

    HI - when I open a folder with a .png file, I get an error that says: "the operation could not be completed. An unknown operating system error has occurred. "Only occurs with the .png files.

    I figured out how to fix it - I go to/library/caches/adobe/bridge CC and delete the existing cache. Bridge to reboot and now I can get a glimpse of the .png files. But it has happened many times in the last month and it's a pain to fix every time. In addition, I lose my cache of bridge.

    Does anyone have a problem with this, or know how I could fix this?

    I just upgraded to El Capitan. I'm on an iMac end of 2013.

    Hi kswecker,

    Please reset the Bridge preferences and then try it.

    Measures

    Start Adobe Bridge, and immediately press Ctrl + Alt + Shift (Windows) or command + Option + shift (Mac OS down) until the dialogue box reset settings appears.

    Select all three options - reset preferences, reset Standard Workspaces and all miniature Purge Cache - and then click OK.

    Reference: troubleshooting errors, freezes | Adobe Bridge | Windows, Mac OS

    Let us know if it works.

    Kind regards

    ~ Mohit

Maybe you are looking for

  • A new disk for the Satellite 2410 404

    Hi all Can someone tell me whether or not first if a 80 GB drive work in my 2410 404? Second, if I'm having problems of heat using a disk 7200 RPM in my 2410-404 and last but not the least if someone has already had a 7200 RPM Hitachi working in a 24

  • OfficeJet 6500 stopped 709n of print, print e-mail messages but does not print silkscreen.

    I deleted and reinstalled the driver software, I run WIN7, but drive is not compatible. I have reset my wireless connection and all the test gives a good result. When I try printing an element, as a recipe that has a print button, printing is no beep

  • Change AVG - how to uninstall AVG Protection policy?

    AVG has changed its privacy policy, so that they can basically SELL my information, including the habits of navigation etc. I want to uninstall AVG Protection of my phone, how do I do? More information: https://NP.reddit.com/r/privacy/comments/3l4apg

  • Cosmetic surgery of blackBerry Smartphones

    Hay guys I thought that since I'm stuck with the curve 8530 for another year. I really want to buy the new curve 3G but the 8530 has done well for me... Who was I in the island so be it again all the sites that I can buy a flat hose with finish chrom

  • Photos is no longer automatically open in Windows Photo Viewer

    original title: Windows Photo Viewer My windows photo viewer does not work like it used to.  When I used to click on a photo he opened with Photo Viewer without doing anything more.  Now, I have to go to 'Open with' and select the Windows Photo Viewe