Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • Files Files
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 384
    • Issues 384
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 63
    • Merge requests 63
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • FilesFiles
  • Issues
  • #912

Cannot set emblems on files with previews that have a high aspect ratio.

I have an extension which puts emblems on files in Nautilus.

A user has reported a bug against the extension in which emblems are not displayed for some files.

I am fairly sure my extension isn't doing anything wrong here, so I suspect this might be an issue with Nautilus. The issue appears to show itself with high-aspect ratio images when previewing is enabled.

To reproduce, here is a minimal nautilus-python extension that adds emblems to all files. Make sure you have nautilus-python installed, save the extension as ~/.local/share/nautilus-python/extensions/bug.py, then restart nautilus, enable file previews, and browse to a folder with images of various sizes.

import gi
from gi.repository import GObject
gi.require_version('Nautilus', '3.0')
from gi.repository import Nautilus

class InfoProvider(GObject.GObject, Nautilus.InfoProvider):
    def update_file_info(self, file):
        file.add_emblem('emblem-generic')
        

The result is that most files get an emblem, but for some previewed image files, there is no emblem:

image

The image files for which it fails appear to be ones with an aspect ratio of greater than about 2:1 in either direction. You can find such an image file here if you don't have one at hand.

Nautilus also outputs the following error upon the extension setting an emblem:

(nautilus:18489): GdkPixbuf-CRITICAL **: 21:45:25.049: gdk_pixbuf_composite: assertion 'dest_y >= 0 && dest_y + dest_height <= dest->height' failed
Edited Oct 01, 2022 by Chris Billington
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking