J'ai du mal à afficher l'image PNG dans mon PrimeFaces 6.1.Primefaces 6.1 Affichage de l'image png avec un fond noir
L'image a été chargée à partir de la base de données au format tableau d'octets. jpg s'affiche bien mais png s'affiche toujours avec un fond noir.
C'est mon code Snippet pour jsf:
<p:graphicImage value="#{fileControlBean.image}">
<f:param name="fileId" value="#{file.fileId}" />
</p:graphicImage>
et le haricot retour comme:
public StreamedContent getImage() throws IOException {
FacesContext context = FacesContext.getCurrentInstance();
if (context.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE) {
// So, we're rendering the HTML. Return a stub StreamedContent so that it will generate right URL.
return new DefaultStreamedContent();
}
else {
// So, browser is requesting the image. Return a real StreamedContent with the image bytes.
String fileId = context.getExternalContext().getRequestParameterMap().get("fileId");
File file = (File) fileBean.getFileCache().get(fileId);
return new ByteArrayContent(file.getThumbnail(),file.getFileType(),file.getFileName());
}
}
Tous les autres dispositifs d'affichage jpg correctement, mais l'image png semble transparente a été mis à 1. Ma question: Comment je peux le remettre à transparent? ou c'est un bug?