Skip to content
  • Halla Rempt's avatar
    Check whether we are using the best-quality image on the clipboard · 09d3bdbe
    Halla Rempt authored
    Firefox can put multiple versions of an image on the clipboard. From
    tests, there's always a fairly useless JPG, and sometimes a decent
    PNG, but of the formats it advertises, in my tests, only these two
    are present. It seems a bit timing dependent, in that if Krita is running,
    chances for getting the PNG clip are a bit better, but still not 100%.
    
    There's nothing more we can do that check whether we've got the best
    image type, in the order PNG, TIFF, BMP, JPEG, and use that.
    
    This is debug output that shows what's on the clipboard if we're lucky:
    
    Format "TIMESTAMP"
    Format "TARGETS"
    Format "MULTIPLE"
    Format "SAVE_TARGETS"
    Format "text/html"
    Format "text/_moz_htmlinfo"
    Format "text/_moz_htmlcontext"
    Format "image/png"
    data 290949 mime "image/png"
    Loaded image succesfully QImage::Format_ARGB32 true
    Format "image/bmp"
    data 0 mime "application/x-zerosize"
    Could not load image of type "image/bmp"
    Format "image/x-bmp"
    data 0 mime "application/x-zerosize"
    Could not load image of type "image/x-bmp"
    Format "image/x-MS-bmp"
    data 0 mime "application/x-zerosize"
    Could not load image of type "image/x-MS-bmp"
    Format "image/x-icon"
    data 0 mime "application/x-zerosize"
    Could not load image of type "image/x-icon"
    Format "image/x-ico"
    data 0 mime "application/x-zerosize"
    Could not load image of type "image/x-ico"
    Format "image/x-win-bitmap"
    data 0 mime "application/x-zerosize"
    Could not load image of type "image/x-win-bitmap"
    Format "image/vnd.microsoft.icon"
    data 0 mime "application/x-zerosize"
    Could not load image of type "image/vnd.microsoft.icon"
    Format "application/ico"
    Format "image/ico"
    data 0 mime "application/x-zerosize"
    Could not load image of type "image/ico"
    Format "image/icon"
    data 0 mime "application/x-zerosize"
    Could not load image of type "image/icon"
    Format "text/ico"
    Format "image/jpeg"
    data 33290 mime "image/jpeg"
    Loaded image succesfully QImage::Format_RGB32 false
    Format "image/tiff"
    data 0 mime "application/x-zerosize"
    Could not load image of type "image/tiff"
    Format "application/x-qt-image"
    Final QImage QImage::Format_ARGB32 true
    
    We cannot do more than this, so I'm closing
    
    BUG:406781
    09d3bdbe