Question

I have an image view in my app. when I try to make it show a jpg file exported from 3ds max, it works. But if it comes from Photoshop, it just does nothing. Why is that? If it is at all important my app gets the image from my server with the following code:

public static Bitmap getWebImage(String URL)
{
    URL myImageURL = null;

    Bitmap bitmap = null;

    try {

        myImageURL = new URL(URL);

        } catch (MalformedURLException error) {


        error.printStackTrace();

        }
        try {

            HttpURLConnection connection = (HttpURLConnection)myImageURL .openConnection();

            connection.setDoInput(true);

            connection.connect();

            InputStream input = connection.getInputStream();

            bitmap = BitmapFactory.decodeStream(input);

            } catch (IOException e) {


            e.printStackTrace();

            }

            return bitmap;

}
Was it helpful?

Solution

Would it be possible for you to upload the two pictures for comparison?

OTHER TIPS

Can you check the color settings of your JPG files? Most likely your JPG files from photoshop is in CMYK rather than RGB, and Android simply doesn't support CMYK.

public static Bitmap getWebImage(String URL) { URL myImageURL = null;

Bitmap bitmap = null;

try {

myImageURL = new URL(URL);

} catch (MalformedURLException error) {

error.printStackTrace();

} try {

HttpURLConnection connection = (HttpURLConnection)myImageURL .openConnection();

connection.setDoInput(true);

connection.connect();

InputStream input = connection.getInputStream();

bitmap = BitmapFactory.decodeStream(input);

} catch (IOException e) {

e.printStackTrace();

}

return bitmap;

}

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top