|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
rudnei
Joined: 29 Dec 2011 Posts: 36
|
Posted: Thu Oct 28, 2021 10:36 pm Post subject: Problem with file name in GET_DIB_INFO@ and GET_DIB_BLOCK@ |
|
|
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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Fri Oct 29, 2021 6:19 am Post subject: |
|
|
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. |
|
Back to top |
|
|
rudnei
Joined: 29 Dec 2011 Posts: 36
|
Posted: Fri Oct 29, 2021 12:15 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Fri Oct 29, 2021 3:09 pm Post subject: |
|
|
rudnei
You can get this code to work by by using:
Code: | filename='.\001.jpg' |
|
|
Back to top |
|
|
rudnei
Joined: 29 Dec 2011 Posts: 36
|
Posted: Fri Oct 29, 2021 8:13 pm Post subject: |
|
|
Dear Paul,
Many thanks, tested and it works!
Cheers
Rudnei |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Sat Oct 30, 2021 7:45 am Post subject: |
|
|
ClearWin+ has now been fixed so that this work-around will not be needed in the future. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|