[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any way to limit the ICONS resource?

On Tue, Jun 7, 2011 at 10:17 AM, Christopher P. Lindsey
<lindsey@xxxxxxxxxxx> wrote:
> Is there any way to limit the ICONS resource to only
> be displayed if images are of a certain size?

Not without custom code modifications.

Based on your requirements, it looks like any modifications would
have to rely on a image library in order to determine the size
of the image.

Hmmm, thinking about it a bit more, it may be possible
to use a custom resource variable and a custom API hook
to resolve the variable.

I.e.  Instead of using the ICON resource, you use a custom
variable in your page layout.  You then have an API hook
for variable resolution that can then check the image
data associated with the message to determine if you want
an icon inserted or not.

API hook is $mhonarc::CBRcVarExpand.

With the $mha_index argument to the function you register, you
can access the Derived hash to retrieve the list of attachments
associated with the message:

  my $list = $mhonarc::Derived{$mha_index};

The return value can be undefined if no attachments exist,
otherwise, it is an array of filenames.

Your function will still need an image library to determine
graphic files sizes.


[Index of Archives]     [Bugtraq]     [Yosemite News]     [Mhonarc Home]