Skip to content
  • Milan Crha's avatar
    "Save Image..." fails on shown attached image in message preview · 0f12f652
    Milan Crha authored
    The image had been stored as "data:image/...;base64;<data>", which
    the context menu Save Image and Copy Image could not handle. This
    resulted in a lengthy error message, which could cause a crash.
    This commit fixes several things:
    a) replace "data:" URI-s with "mail://" URI-s, which means less resources
       are needed; it also fixes the Save/Copy Image actions as a side effect;
    b) fix memory leak for tiff images;
    c) let to Save/Copy Image handle base64-encoded "data:" URI-s (as
       the source HTML message can still contain them);
    d) shorten the URI in the error message when it's too long;
    e) pass also "filename" into the URI, thus the Save Image has prefilled it,
       the same as attachment's "Save as" action.
    
    Reported downstream at:
    https://bugzilla.redhat.com/show_bug.cgi?id=1657361
    0f12f652