Jump to content
  • Loading images from AWT with alpha channel problem


    hnizdilova
    Assigned User teodord
    CategoryBug report
    PriorityUrgent
    ReproducibilityAlways
    ResolutionFixed
    SeverityCritical
    StatusClosed

    I created image element with java.awt.Image 'Image Expression Class'. The source image has alpha channel but while the report is executed, the image element isn't transparent.

     

    If I'm right the problem arises during JRFillImage.evaluateImage(...) operation. JRImageRenderer with incorrectly set imageData is created there, because it uses JRImageLoader#loadImageDataFromAWTImage(Image) where BufferedImage of TYPE_INT_RGB type is created.

     

    Can it be fixed in next version?

    I use JasperReport 1.2.8 (with iReport 1.2.8)



    User Feedback

    Recommended Comments

     

    Hi,

     

    I think this is something we solved in the JR 1.3.0.

    It would be great if you could upgrade and let us know if it works for you.

     

    Thank you,

    Teodor

     

    Link to comment
    Share on other sites

    I tried it on JR 1.3.0, but the problem stays :(

     

    During evaluating image JRImageRenderer#getInstance() without specified imageType is called now and on that place this imageType is set on IMAGE_TYPE_JPG by default. But lately JRImageLoader calls JRAbstractImageEncoder#encode(...) where transparency isn\'t supported for JPG imageType.

     

    Why you possibly doesn\'t take into consideration \'Transparent\' checkbox in Element properties dialog?

    Link to comment
    Share on other sites

     

    Hi,

     

    I think this could be a good feature request, so it would be great if you could post it here:

    http://www.jasperforge.org/sf/tracker/do/listArtifacts/projects.jasperreports/tracker.feature_requests

     

    Until it gets implemented, you could workaround the limitation by calling the getInstance() method with all the 3 parameters in your image expression, instead of just passing the Image object. This way you can fully control the image encoding.

     

    I hope this helps.

    Teodor

     

    Link to comment
    Share on other sites


×
×
  • Create New...