on 03-31-2009 9:18 AM
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
What is the image format? Can the browser display them natively? If yes, is the URL correct?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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();
}
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.