Silverfrost Forums

Welcome to our forums

Problem with file name in GET_DIB_INFO@ and GET_DIB_BLOCK@

28 Oct 2021 9:36 #28400

Hi, I am trying to open a file that has its name starting with a digit; both functions fail. If I add a letter to the beginning of the name, they work. Is there any workaround this? I can't change the filenames. Regards, Rudnei

29 Oct 2021 5:19 #28402

Rudnei

I don't know how you can fix this but if you can send a sample program and dib file then we can probably make these functions work for you.

29 Oct 2021 11:15 #28405

Dear Paul,

Sure, here it is.

[img]https://drive.google.com/file/d/1y_7llieOQXM3Tg1qAnFtFvTr5DLaLMgV/view?usp=sharing[/img]

[img]https://drive.google.com/file/d/1llheehFRn8qYGOn5uudMTub6ibpa7x9c/view?usp=sharing[/img]

And the program:

winapp program test_dib implicit none include <windows.ins> integer :: ctrl,hres,vres,no_de_bits,rslt character,dimension(:,:,:),allocatable :: pixels character(len=80) :: message,filename filename='001.jpg' ! ⇐= will fail on get_dib_size@ and get_dib_block@ filename='a001.jpg' ! ⇐= filename starting with a letter works ok!
call get_dib_size@(filename,hres,vres,no_de_bits,rslt) if (rslt/=0) then call dos_error_message@(rslt,message) print *,message else allocate(pixels(3,hres,vres),stat=rslt) if (rslt/=0) then print *,'Error while trying to allocate image array.' else call get_dib_block@(filename,pixels,hres,vres,0,0,hres,vres,0,0,rslt) if (rslt/=0) then call dos_error_message@(rslt,message) print *,message else rslt=winio@('%ww%ca[Image]&') rslt=winio@('%gr[black,rgb_colours]&',hres,vres) rslt=winio@('%lw',ctrl) call display_dib_block@(0,0,pixels,hres,vres,0,0,hres,vres,0,0,rslt) end if end if end if end program test_dib

Cheers Rudnei

29 Oct 2021 2:09 #28407

rudnei

You can get this code to work by by using:

filename='.\001.jpg'
29 Oct 2021 7:13 #28409

Dear Paul, Many thanks, tested and it works! Cheers Rudnei

30 Oct 2021 6:45 #28410

ClearWin+ has now been fixed so that this work-around will not be needed in the future.

Please login to reply.