You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2014/06/16 13:05:01 UTC

[jira] [Resolved] (WICKET-5602) DynamicImageResource should set the mime type after reading the image data

     [ https://issues.apache.org/jira/browse/WICKET-5602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-5602.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.17.0
                   7.0.0-M3
         Assignee: Martin Grigorov

I've moved the setting of the mime type to the response headers after the call to #getImageData().
This way you can change the format by using #setFormat() dynamically.

> DynamicImageResource should set the mime type after reading the image data
> --------------------------------------------------------------------------
>
>                 Key: WICKET-5602
>                 URL: https://issues.apache.org/jira/browse/WICKET-5602
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.14.0
>            Reporter: Patrick Davids
>            Assignee: Martin Grigorov
>             Fix For: 7.0.0-M3, 6.17.0
>
>
> Hi,
> I wondered about the method setFormat(String format) which is public and accessable e.g. in getImageData().
> Overriding getImageData() and calling setFormat() to e.g. changing the format on-the-fly while creating the bytes does not have any effect due to call sequence
> - getFormat()
> - getImageData()
> in newResourceResponse(final Attributes attributes)
> of DynamicImageResource
> This could lead in confusion... so it should be private, I think.
> But, in the other hand, switching the format, could be a nice feature, so maybe leave it public, but then pay intention for calling sequence.
> I would prefer the feature request, because we have a fallback implementation in getImageData() to a another image, with another format, if no bytes are available.
> In our case we blob profile images of users in png format into the database, and if no profile image is avaliable we fallback to a default icon in svg format, and here the correct mime-type is important, not to have broken images.
> kind regards



--
This message was sent by Atlassian JIRA
(v6.2#6252)