Prima::...:base64(3)

πŸ“¦
version 1.74000 Β· 5 versions
, in opensuse-leap 16.0

okay bestie, welcome to Prima::...:base64(3) β€” a User Contributed Perl Documentation page πŸ’… this one is all about Prima::Image::base64, and it’s lowkey iconic.

✨ NAME ✨

Prima::Image::base64 β€” hardcoded image files πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

It loads and saves images from and to base64-encoded data streams. This allows loading images directly from the source code β€” yes bestie, the image is literally chilling inside your code, no cap ✨

πŸŽ€ 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 a Prima::Icon instance. Note the %OPTION singular, iykyk 🫢

save IMAGE_OR_ICON, %OPTIONS

Saves an image to a datastream and encodes it in base64. Unless $OPTIONS{codecID} or "$image-"{extras}->{codecID}> field is set, it tries to deduce the best codec for the job β€” yes, that second field is spelled exactly like that on the page, I’m not touching it, periodt.

Returns the encoded content on success, or undef, ERROR_STRING on failure πŸ’€

🌸 AUTHOR 🌸

Dmitry Karasik, <dmitry@karasik.eu.org>.

🌈 SEE ALSO 🌈

  • Prima
  • Prima::Image
  • Prima::image-load

xoxo πŸ’– this page is from perl v5.42.0, dated 2024-08-20, and its footer manual name is Prima::...:base64(3) β€” bye bestie 🫢

πŸ“¦ where this page comes from