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

[jira] [Created] (WICKET-5602) setFormat() of DynamicImageResource is confusing / make private or feature?

Patrick Davids created WICKET-5602:
--------------------------------------

             Summary: setFormat() of DynamicImageResource is confusing / make private or feature?
                 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


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)
od 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 than 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 our database, and if no profile image is avaliable we fallback to an 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)