cancel
Showing results for 
Search instead for 
Did you mean: 

images not visible in Web Dynpro

former_member192766
Participant
0 Kudos

Hi All,

I am trying to show pictures from KM in a Web Dynpro for Java application but I have some issues with some pictures created and modified in Macintosh.

Pictures/images created in Adobe Photoshop CS2 Macintoch are not visible.

Any idea?

Regards,

Ridouan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

What is the image format? Can the browser display them natively? If yes, is the URL correct?

Armin

former_member192766
Participant
0 Kudos

Hi Armin,

The format is 240 by 340 px, the size is 85kb.

The browser is displaying the images correctly and I can't open the images with MS Paint.

I am using Windows viewer to view these images.

The URL is correct as I have other images (not created in Macintoch) and Web Dynpro is displaying these images just fine. The size is here 10KB.

If I place a link to the image then it will be displayed but not with the KM code.

wdContext.currentContextElement().setImage("/irj/go/km/docs/documents/Telefoongids/" + klaccount + ".jpg");

IPublicTelGidController.IDetailsElement details = wdContext.currentDetailsElement();

String klaccount = wdContext.currentDetailsElement().getKlaccount();

String foto_ok = wdContext.currentDetailsElement().getFoto_Ok();

String manager = wdContext.currentDetailsElement().getManager();

if (foto_ok.equals("X") && manager.equals("X")){

IWDClientUser wdClientUser = WDClientUser.getCurrentUser();

IUser sapUser = wdClientUser.getSAPUser();

com.sapportals.portal.security.usermanagement.IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);

//Getting the Resource...

IResourceContext resourseContext = new ResourceContext(ep5User);

IResourceFactory resourseFactory = ResourceFactory.getInstance();

String path = "/documents/Telefoongids/" + klaccount + ".jpg";

RID pathRIDimg = RID.getRID(path);

com.sapportals.wcm.repository.IResource resourceimg =

resourseFactory.getResource(pathRIDimg, resourseContext);

//Reading the image file...

BufferedInputStream bufIn =

new BufferedInputStream(resourceimg.getContent().getInputStream());

byte[] imagebyte = new byte[bufIn.available()];

bufIn.read(imagebyte);

//Mapping the image as a WebResourceu2026.

//IWDWebResource webResource = WDWebResource.getWebResource(imagebyte,WDWebResourceType.GIF_IMAGE);

IWDWebResource webResource = WDWebResource.getWebResource(imagebyte,WDWebResourceType.JPG_IMAGE);

wdContext.currentContextElement().setImage(webResource.getURL());

}

else{

wdContext.currentContextElement().setImage("");

}

}

catch (Exception e)

{

e.printStackTrace();

}

Former Member
0 Kudos

Hi,

Try to save the picture in .bmp format and see.

former_member192766
Participant
0 Kudos

Thanks, does not work.

I think it's about the size.

Answers (0)