2017-10-04 6 views
0

내 PrimeFaces 6.1에 png 이미지를 표시하는 데 어려움이 있습니다.Primefaces 검은 색 바탕에 6.1 png 이미지 디스플레이

이미지가 데이터베이스에서 바이트 배열 형식으로로드되었습니다. jpg가 잘 표시되지만 png는 항상 검은 색 배경으로 표시됩니다. 다른 모든 JPG 디스플레이 제대로

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()); 
    } 
} 

하지만, PNG로 이미지 1. 내 질문에 설정된 투명 같습니다과 같은

<p:graphicImage value="#{fileControlBean.image}"> 
    <f:param name="fileId" value="#{file.fileId}" /> 
</p:graphicImage> 

다시 콩 :

는 JSF 내 코드 조각입니다 : 어떻게 투명하게 설정할 수 있습니까? 아니면 버그입니까?

답변

0

죄송합니다.이 퀘스트는 제대로 실행되지 않았습니다. 검은 배경 문제는 투명 문제와 함께 자체 png로 인해 발생했습니다. 나는 inkscape를 사용하여 png를 다시 생성합니다. 사라진 검은 배경.

관련 문제