Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting Raster Transparency using "Add values from display" doesn't work #25740

Closed
qgib opened this issue Jan 12, 2018 · 14 comments
Closed

Setting Raster Transparency using "Add values from display" doesn't work #25740

qgib opened this issue Jan 12, 2018 · 14 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority Rasters Related to general raster layer handling (not specific data formats) Regression Something which used to work, but doesn't anymore

Comments

@qgib
Copy link
Contributor

qgib commented Jan 12, 2018

Author Name: Michel Stuyts (@mstuyts)
Original Redmine Issue: 17845
Affected QGIS version: master
Redmine category:rasters
Assignee: Alessandro Pasotti


If I try to set the Transparent Pixels using "Add values from display" it gives no result. If I close the Layer Properties window after using "Add values from display" using OK or Cancel, QGIS becomes unresponsive on Windows and closes without a warning on Ubuntu.

Also the Layer Properties window remains minimized after clicking in the map window when trying to use "Add values from display".

@qgib
Copy link
Contributor Author

qgib commented Jan 12, 2018

Author Name: Alessandro Pasotti (@elpaso)


Can you please add step-by-step procedure to reproduce the issue and if possible a minimal project with a small dataset?


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jan 12, 2018

Author Name: Michel Stuyts (@mstuyts)


I tested it with multiple raster-files (TIF and PNG). One of those files can be downloaded from: https://downloadagiv.blob.core.windows.net/winterbedkaart/Winterbedkaart+(Watertoets).zip

  1. Start a new project in QGIS 2.99
  2. Add the downloaded tiff-file (Wtrbed.tif)
  3. Open the layer Properties Window
  4. Go to the "Transparency" tab
  5. Click on the "add values from display" button (now the Properties Window remains the same size on Ubuntu Linux and minimizes on Windows)
  6. Click somewhere on the white (or another color) part in the Map Window (now the Properties Window remains minimized on Windows)
  7. On Windows double click on the minimized topbar of the Properties Window on the bottom left of the screen to maximize it. (now no color values are added to the "Transparent pixel list" on both Windows and Ubuntu Linux)
  8. Click on the OK or Cancel button

After these steps the effect is different on Windows and Ubuntu Linux:

  • On an Windows 10 machine: the Properties window closes, but clicking anywhere in the main window has no effect. QGIS can only be closed by using Windows Task Manager and killing the process
  • On an Ubuntu Linux machine: QGIS closes without a warning.

@qgib
Copy link
Contributor Author

qgib commented Jan 12, 2018

Author Name: Michel Stuyts (@mstuyts)


In the Layer Styling Panel, the "Add values from display" button in the Transparency Tab works as it should.

@qgib
Copy link
Contributor Author

qgib commented Jan 15, 2018

Author Name: Alessandro Pasotti (@elpaso)


Thanks for adding the information, looking at this bug now ...


  • assigned_to_id was configured as Alessandro Pasotti

@qgib
Copy link
Contributor Author

qgib commented Jan 15, 2018

Author Name: Alessandro Pasotti (@elpaso)


  • priority_id was changed from Normal to High
  • regression was changed from 0 to 1

@qgib
Copy link
Contributor Author

qgib commented Jan 15, 2018

Author Name: Alessandro Pasotti (@elpaso)


PR: #6068
Tested on xenial, needs to be tested on windows/mac.


  • status_id was changed from Feedback to In Progress
  • pull_request_patch_supplied was changed from 0 to 1

@qgib
Copy link
Contributor Author

qgib commented Jan 29, 2018

Author Name: Anónimo (Anónimo)


Applied in changeset 75e613c.


  • status_id was changed from In Progress to Closed
  • done_ratio was changed from 0 to 100

@qgib
Copy link
Contributor Author

qgib commented Feb 7, 2018

Author Name: Michel Stuyts (@mstuyts)


The main part of this issue (QGIS crashing or blocking) is solved, but a minor part of it still isn't ok. The issue is different on Ubuntu and Windows.

On Ubuntu Linux:

  1. Start a new project in QGIS 2.99
  2. Add the downloaded tiff-file (Wtrbed.tif)
  3. Open the layer Properties Window
  4. Go to the "Transparency" tab
  5. Click on the "add values from display" button
  6. Now the Properties Window disappears (I think it's closed) and the cursor changes to a cross
  7. Now click somewhere in the map and the cursor changes back to an arrow, but after that nothing happens anymore. There is nothing added to the transparent pixel list when the Properties Window is reopened.

On Windows 10:

  1. Start a new project in QGIS 2.99
  2. Add the downloaded tiff-file (Wtrbed.tif)
  3. Open the layer Properties Window
  4. Go to the "Transparency" tab
  5. Click on the "add values from display" button
  6. Now the Properties Window minimizes and the cursor changes to a cross
  7. Now click somewhere in the map and the cursor changes back to an arrow, but the Properties Window remains minimized
  8. Now double click on the minimized title bar of the Properties Window to enlarge it again.
  9. The clicked on color value is added to the transparent pixel list.
  10. The desired color is transparent.

If in Windows steps 3 to 7 are repeated, there are two minimized Properties Windows. By double clicking on their title bars, both can be enlarged and can exist next to each other:

  1. Start a new project in QGIS 2.99
  2. Add the downloaded tiff-file (Wtrbed.tif)
  3. Open the layer Properties Window
  4. Go to the "Transparency" tab
  5. Click on the "add values from display" button
  6. Now the Properties Window minimizes and the cursor changes to a cross
  7. Now click somewhere in the map and the cursor changes back to an arrow, but the Properties Window remains minimized
  8. Open the layer Properties Window
  9. Go to the "Transparency" tab
  10. Click on the "add values from display" button
  11. Now the Properties Window minimizes and the cursor changes to a cross
  12. Now click somewhere in the map and the cursor changes back to an arrow, but the Properties Window remains minimized
  13. Now double click on the first minimized title bar of the Properties Window to enlarge it again.
  14. Now double click on the second minimized title bar of the Properties Window to enlarge it again.
  15. The clicked on color value is added once to each transparent pixel list.
  16. The desired color is transparent.

  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Feb 8, 2018

Author Name: Alessandro Pasotti (@elpaso)


I see: apparently the showMinimized function behaves differently on Linux and Windows (and nobody knows about Mac)

I'm testing (on Linux) and I observe a different behavior on KDE than what you've reported.

Btw, I see a possible solution in completely hiding the dialog instead of trying to minimize it.

I'll make a new PR with this new approach, I'd really appreciate if you could test it when ready.

@qgib
Copy link
Contributor Author

qgib commented Feb 8, 2018

Author Name: Alessandro Pasotti (@elpaso)


New PR #6294

Works fine on Win 10 and Kubuntu Xenial.

@qgib
Copy link
Contributor Author

qgib commented Feb 9, 2018

Author Name: Anónimo (Anónimo)


Applied in changeset e435d79.


  • status_id was changed from Reopened to Closed

@qgib qgib closed this as completed Feb 9, 2018
@qgib
Copy link
Contributor Author

qgib commented Feb 9, 2018

Author Name: Alessandro Pasotti (@elpaso)


Please test this new patch


  • resolution was changed from to fixed/implemented

@qgib
Copy link
Contributor Author

qgib commented Feb 12, 2018

Author Name: Michel Stuyts (@mstuyts)


Problem solved! It works in Ubuntu 16.04 and Windows 10. Thank you very much.

@qgib
Copy link
Contributor Author

qgib commented Feb 12, 2018

Author Name: Alessandro Pasotti (@elpaso)


You are welcome! Thank you for the feed-back and thanks to all QGIS sponsors and donors that made this happen!

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Rasters Related to general raster layer handling (not specific data formats) Crash/Data Corruption Regression Something which used to work, but doesn't anymore labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority Rasters Related to general raster layer handling (not specific data formats) Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

1 participant