NAME
Prima::Image::base64 - hard-coded image files
DESCRIPTION
Handles base64-encoded data streams to load images directly from source code.
SYNOPSIS
my $icon = Prima::Icon->load_stream(<<~'ICON');
R0lGODdhIAAgAIAAAAAAAP///ywAAAAAIAAgAIAAAAD///8CT4SPqcvtD6OctNqLcwogcK91nEhq
3gim2Umm4+W2IBzX0fvl8jTr9SeZiU5E4a1XLHZ4yaal6XwFoSwMVUVzhoZSaQW6ZXjD5LL5jE6r
DQUAOw==
ICON
print $icon->save_stream;
API
- load, load_image BASE64_STRING, %OPTIONS
-
Decodes BASE64_STRING and tries to load an image from it. Returns image reference(s) on success, or
undef, ERROR_STRING
on failure. - load_icon BASE64_STRING, %OPTION
-
Same as
load_image
but returns aPrima::Icon
instance. - save IMAGE_OR_ICON, %OPTIONS
-
Saves image into a datastream and return it encoded in base64. Unless
$OPTIONS{codecID}
or$image-
{extras}->{codecID}> is set, tries to find the best codec for the job.Returns encoded content on success, or
undef, ERROR_STRING
on failure.
AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>.