Namespaces
Variants
Actions

Archived:Incorrect RGB values for JPG images on Series 40 3rd Edition (Known Issue)

Jump to: navigation, search
Archived.png
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The RGB values of the pixels in a JPG image on Series 40 3rd Edition devices may be altered from the values in the original images.

Article Metadata

Tested with
Devices(s): Nokia 5300, Nokia 6270

Compatibility
Platform(s): Series 40 3rd Edition

Article
Created: User:Technical writer 1 (04 Jun 2007)
Last edited: hamishwillee (28 Jun 2012)

Description

The RGB values of the pixels may be altered to differ from the values in the original images. For example, when you load an image which has only one color: RGB 255,254,128 and the RGB values from the image object are read after loading it in the MIDlet, they have been altered to 255,255,109. The problem is only limited to JPG images, the problem does not occur in PNG images.

How to reproduce

The following code sample should print "ARGB:255,255,254,128" but prints "ARGB:255,255,255,109":

img= Image.createImage("/yellow.jpg");
in>t[] srcpixels=new int[1];
img.getRGB(srcpixels, 0,1,0,0,1,1);
System.out.println("ARGB:"+((srcpixels[0] >> 24) & 0xFF) + "," + ((srcpixels[0] >> 16) & 0xFF)+ "," + ((srcpixels[0] >> 8) & 0xFF) + "," + ((srcpixels[0] >> 0) & 0xFF));
This page was last modified on 28 June 2012, at 07:58.
70 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved