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

bug when writing PNG #1354

Closed
alaingdl opened this issue Aug 6, 2022 · 10 comments
Closed

bug when writing PNG #1354

alaingdl opened this issue Aug 6, 2022 · 10 comments
Labels
duplicate This issue or pull request already exists needs more information! Further information is requested regression Something that used to work does not work anymore todo-test

Comments

@alaingdl
Copy link
Contributor

alaingdl commented Aug 6, 2022

Yes, this problem may depend on various parameters but this code don't work on my laptop for PNG (just uniformly black) on current GDL git version on U22.04

pro BUG_PNG
defsysv, '!GDL', exist=exist
if exist then prefix='GDL_' else prefix='IDL_'
plot, findgen(10)
WRITE_PNG, prefix+'fig_1_true.png', TVRD(/TRUE)
WRITE_PNG, prefix+'fig_2_notrue.png', TVRD()
; not valid WRITE_JPEG, 'fig3_true.jpeg', TVRD(/TRUE)
WRITE_JPEG, prefix+'fig4_notrue.jpeg', TVRD()
end
@GillesDuvert
Copy link
Contributor

All the above give OK plots for me.
(in PR #1338)

@jtappin
Copy link

jtappin commented Aug 8, 2022

I believe this is the same issue as #1206.

@GillesDuvert
Copy link
Contributor

solved in #1358 ?

@brandy125
Copy link

I have the same problem. Is there any workaround to get 3 bands images written as png or bmp that are not completely black?

@alaingdl
Copy link
Contributor Author

ASAP I will try to compile with IM instead of GM just in case.

@alaingdl
Copy link
Contributor Author

I tried but did not succeed to compile with Image Magick on Ubuntu 22.04 up-to-date

I also tried to replace our FindImageMagick.cmake by the new one (+ related ones) but same problem
I don't know if it is related to the location of the IM sub-dir (/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.11) or the .pc files

I will try later on Debian11

@GillesDuvert GillesDuvert added needs more information! Further information is requested todo-test labels Sep 18, 2022
@alaingdl
Copy link
Contributor Author

Sorry for the delay, quite busy with all those data coming from MIRI on JWST 😄

In fact the files written in GDL can be read back in GDL & IDL and do give good plots. But they cannot be displayed in external tools.

Maybe it is just because the internal type is not the good one ?

GDL> gdl=read_png('GDL_fig_1_true.png')
GDL> idl=read_png('IDL_fig_1_true.png')    ;generated by idl 8.8, same computer
GDL> help, idl, gdl
IDL             BYTE      = Array[3, 960, 600]
GDL             UINT      = Array[3, 960, 600]

@alaingdl
Copy link
Contributor Author

OK, I just compile GDL version 1.0.0 and 1.0.1 (on ubuntu 22.04)

  • WRITE_PNG in version 1.0.1 is buggy
  • WRITE_PNG in version 1.0.0 is OK

A.

PS: I forgot to mention I have the same problem on OSX 10.14.6

@alaingdl alaingdl added the regression Something that used to work does not work anymore label Sep 19, 2022
@GillesDuvert
Copy link
Contributor

so this is a duplicate of #1206

@GillesDuvert GillesDuvert added the duplicate This issue or pull request already exists label Sep 19, 2022
@alaingdl
Copy link
Contributor Author

Size of outputs are always changing !
But we can check the type inside ...
(I also look at pngcheck but I see no way to check more than the validity)

Files generated by :

[...]
plot, findgen(10)
WRITE_PNG, prefix+'fig_1_true.png', TVRD(/TRUE)
[...]
ll -gG */G*fig_1*
-rw-rw-r-- 1  5711 sept. 19 15:14 gdl100/GDL_fig_1_true.png
-rw-rw-r-- 1  7344 sept. 19 15:21 gdl101/GDL_fig_1_true.png
-rw-rw-r-- 1 16400 oct.  19 00:09 gdl101git221018/GDL_fig_1_true.png
-rw-rw-r-- 1  5122 nov.   8 09:40 gdl101git221108/GDL_fig_1_true.png
-rw-rw-r-- 1  4601 nov.  10 18:09 gdl101git221110/GDL_fig_1_true.png
-rw-rw-r-- 1  4601 nov.  27 23:08 gdl101git221127/GDL_fig_1_true.png
-rw-rw-r-- 1 19864 nov.  14 11:13 gdl_deb/GDL_fig_1_true.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists needs more information! Further information is requested regression Something that used to work does not work anymore todo-test
Projects
None yet
Development

No branches or pull requests

4 participants