Skip to content

Picture layout element does not handle properly a non-existing filepath when provided with an expression #42280

Description

@nicogodet

Describe the bug

I think it's a regression for layout.

When I define a expression for a raster picture in an atlas layout, it falls back to SVG picture.
layout

bug_report.zip

@gioman I don't have idea for a better title... feels free to modify it.

How to Reproduce

  1. Open project
  2. Open the only print layout
  3. Try to switch from SVG to raster (you can't)
  4. Delete expression
  5. Switch to raster
  6. Try to use a field as an expression (it switch to SVG)
  7. See warnings in logs

QGIS and OS versions
Tested on both 3.18.0 and 3.16.4 new OSgeo4W

Additional context
It worked fine on 3.16.3 as I used an expression to display picture based on attributs on a previous project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugEither a bug report, or a bug fix. Let's hope for the latter!Print LayoutsRelated to QGIS Print Layouts, Atlas or Reporting frameworks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions