D15071: Don't draw frames and shadows around images with transparency

Mark Gaiser noreply at phabricator.kde.org
Sat Aug 25 18:05:47 BST 2018


markg added a comment.


  (repost from D15069 <https://phabricator.kde.org/D15069>)
  
  Hi Nate,
  
  I'm afraid this will give inconsistent frames, at least that will be the perception of the user.
  The hasAlpha function on a QPixmap (probably) boils down to executing this function:
  
    bool QX11PlatformPixmap::hasAlphaChannel() const                                                                                                                                                                                                                           
    {                                                                                                                                                                                                                                                                          
        if (picture && d == 32)                                                                                                                                                                                                                                                
            return true;                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                               
        if (x11_mask && d == 1)                                                                                                                                                                                                                                                
            return true;                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                               
        return false;                                                                                                                                                                                                                                                          
    } 
  
  But there are quite some places in Qt where the alpha channel checks are done differently.The above would be for X11, it's likely different on wayland, etc...
  
  So where is this going to be inconsistent? Well, with images that "have" an alpha channel but don't use it.
  This happens when saving an image. It's often a setting to keep transparency or not (it is in photoshop and gimp).
  Therefore you can - and will - have people that have images with an alpha channel but don't use it so they don't get a frame. While the very same image when saved differently (and in png as well) will have a frame. That's going to be a bug report from that user i guess ;)
  
  Having said that, i'm much more in favor of an all-or-nothing approach. Not some logic somewhere that dictates when an image has a frame and when it doesn't.
  We've had frames for years so perhaps it's time to just flip the switch and see how users like it. So just flip that switch by default to no frames.
  
  - end of previous comment.
  
  As @ngraham figured out, Qt apparently does some more in depth transparency checking. I wonder if it does a pixel-by-pixel test, that would be expensive.
  Anyhow, i'd just say - to be consistent - to flip the switch. No frames at all anywhere. It looks just weird to me to have folders where some images have frames and some don't.
  For users it will be weird as well, they might even consider it a bug and report it.
  
  It would be a whole different story if the frames were part of a larger area (so including the filename), kinda like this <https://s3.envato.com/files/31319902/screenshot1.jpg>. But it isn't. It's merely directly around the image.
  It probably (assumption) was a way to imitate Finder (of macOS) and the old "Windows Live Photo Gallery" specially the later one has a nearly 1-on-1 matching with the frame Dolphin draws.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D15071

To: ngraham, #frameworks, #dolphin, #vdg, broulik, cfeck
Cc: markg, abetts, bruns, kde-frameworks-devel, michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180825/0f288ada/attachment.htm>


More information about the kfm-devel mailing list