forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with file name in GET_DIB_INFO@ and GET_DIB_BLOCK@

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
rudnei



Joined: 29 Dec 2011
Posts: 34

PostPosted: Thu Oct 28, 2021 10:36 pm    Post subject: Problem with file name in GET_DIB_INFO@ and GET_DIB_BLOCK@ Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Oct 29, 2021 6:19 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
rudnei



Joined: 29 Dec 2011
Posts: 34

PostPosted: Fri Oct 29, 2021 12:15 pm    Post subject: Reply with quote

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(:,:,Smile,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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Oct 29, 2021 3:09 pm    Post subject: Reply with quote

rudnei

You can get this code to work by by using:

Code:
filename='.\001.jpg'
Back to top
View user's profile Send private message AIM Address
rudnei



Joined: 29 Dec 2011
Posts: 34

PostPosted: Fri Oct 29, 2021 8:13 pm    Post subject: Reply with quote

Dear Paul,
Many thanks, tested and it works!
Cheers
Rudnei
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sat Oct 30, 2021 7:45 am    Post subject: Reply with quote

ClearWin+ has now been fixed so that this work-around will not be needed in the future.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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