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 

%ss and browse_for_folder@ under 64bit
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed Jul 13, 2016 7:08 am    Post subject: Reply with quote

Paul,

Is it possible to release a version 8.05.1 or 8.06.0 to fix the problem with allocate, as it is a key capability with Ver 8.x ?

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jul 13, 2016 10:47 am    Post subject: Reply with quote

Here is a link for downloading an interim release of the various DLLs.

Please make sure that you backup your existing DLLs before installing and testing the new ones.

https://www.dropbox.com/s/2sn929jqilhgmp8/newDLLs.zip?dl=0
Back to top
View user's profile Send private message AIM Address
Chemie



Joined: 07 Mar 2015
Posts: 49

PostPosted: Thu Jul 14, 2016 8:55 am    Post subject: Re: Reply with quote

PaulLaidler wrote:
Here is a link for downloading an interim release of the various DLLs.

Please make sure that you backup your existing DLLs before installing and testing the new ones.

https://www.dropbox.com/s/2sn929jqilhgmp8/newDLLs.zip?dl=0


Paul, thanks for the interim release of the various DLLs.
I have tested the allocation and found no errors. But now, I have problems with display_dib_block@, when I use large arrays. Are there some limitations for the size of pictures? To illustrate my problem, I have written a test program, first I allocate a small picture und display the upper left in red and the lower right corner in green colour. In the second part, I allocate a large picture and display also the upper left corner, this goes well, but when I display the lower right corner, the program crashes. Here is the testprogram:
winapp

program dibblocktest
use mswin
implicit none

integer*4 a,i,j,ii,jj,i1,i2,i3,xsize,ysize,xpic,ypic,picctrl,aerror
integer*4 func,mode,errcode

character*1, dimension(:,:,Smile, allocatable :: picture

func=0
mode=0
errcode=0
i1=1
i2=2
i3=3
xpic=1000
ypic=1000

a=winio@('%ca[Picture]&')
a=winio@('%gr&',xpic,ypic)
a=winio@('%lw',picctrl)

! create and allocate a small picture
xsize=5000
ysize=5000
allocate(picture(i3,xsize,ysize),stat=aerror)
if (aerror.ne.0) goto 1

! create and display a small red picture (upper left corner)
do i=1,xpic
do j=1,ypic
picture(i1,i,j)=char(255)
picture(i2,i,j)=char(0)
picture(i3,i,j)=char(0)
enddo
enddo
call display_dib_block@(i1,i1,picture,xsize,ysize,i1,i1,xpic,ypic,func,mode,errcode)

call sleep@(2.0)

! create and display a small green picture (lower right corner)
do i=1,xpic
ii=xsize-xpic+i
do j=1,ypic
jj=ysize-ypic+j
picture(i1,ii,jj)=char(0)
picture(i2,ii,jj)=char(255)
picture(i3,ii,jj)=char(0)
enddo
enddo
call display_dib_block@(i1,i1,picture,xsize,ysize,xsize-xpic,ysize-ypic,xpic,ypic,func,mode,errcode)

call sleep@(2.0)
deallocate(picture)


! create and allocate a large picture ( ca. 7 gb)
xsize=50000
ysize=50000
allocate(picture(i3,xsize,ysize),stat=aerror)
if (aerror.ne.0) goto 1

! create and display the upper left corner of the large picture
do i=1,xpic
do j=1,ypic
picture(i1,i,j)=char(255)
picture(i2,i,j)=char(0)
picture(i3,i,j)=char(0)
enddo
enddo
call display_dib_block@(i1,i1,picture,xsize,ysize,i1,i1,xpic,ypic,func,mode,errcode)

call sleep@(2.0)

! create and display the lower right corner of the large picture
! this display fails, I don't know why, it is the same code as with the small picture
do i=1,xpic
ii=xsize-xpic+i
do j=1,ypic
jj=ysize-ypic+j
picture(i1,ii,jj)=char(0)
picture(i2,ii,jj)=char(255)
picture(i3,ii,jj)=char(0)
enddo
enddo
call display_dib_block@(i1,i1,picture,xsize,ysize,xsize-xpic,ysize-ypic,xpic,ypic,func,mode,errcode)
deallocate(picture)

1 end

Have I made an error?
Thanks
Chemie
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Thu Jul 14, 2016 1:22 pm    Post subject: Reply with quote

Chemie,

I think I found some minor problems:
integer*8 picctrl
call display_dib_block@ (xpos,ypos where top corner is 0,0 and also array offset could be 0,0

However the main problem does exist. I tried to see what size failed: picture must be less than 2gb.
Code:
program dibblock
   use mswin
   implicit none
 
   integer*4 a, xpic,ypic, xsize,ysize, i
   integer*8 picctrl
  !
   xpic   = 1000
   ypic   = 800
  !
   a = winio@('%ca[Picture]&')
   a = winio@('%gr&', xpic,ypic)
   a = winio@('%lw', picctrl)
  !
  ! create and allocate a small picture
   do i = 5000, 50000, 2500
     xsize=i
     ysize=i
     call dibblocktest ( xsize,ysize )
   end do
!
 end

 subroutine dibblocktest  ( xsize,ysize )
   use mswin
   implicit none
   integer*4 xsize,ysize
!
   integer*4 a,i,j,ii,jj,i1,i2,i3,xpic,ypic,xpos,ypos
   integer*4 func,mode,errcode, aerror
!
   character*1, allocatable :: picture(:,:,:)
!
   func   = 0
   mode   = 0
   errcode= 0
   i1     = 1
   i2     = 2
   i3     = 3
!
   xpic   = 1000 - 200
   ypic   = 800  - 200
!
   write (*,*) 'create and allocate a picture'
   write (*,*) xsize,' by',ysize
   allocate ( picture(i3,xsize,ysize), stat=aerror)
   if (aerror.ne.0) then
     write (*,*) 'error allocating array : stat=',aerror
     return
   else
     write (*,*) size(picture)/1024./1024.,' mb'
   end if

   write (*,*) 'create and display a small red picture (upper left corner)'
   do i=1,xpic
     do j=1,ypic
       picture(i1,i,j) = char(255)
       picture(i2,i,j) = char(0)
       picture(i3,i,j) = char(0)
     enddo
   enddo
   xpos = 0
   ypos = 0
   call display_dib_block@ (xpos,ypos, picture,xsize,ysize, i1,i1, xpic,ypic, func,mode,errcode)
   call sleep@(0.5)

   write (*,*) 'create and display a small green picture (lower right corner) '
   do i=1,xpic
     ii=xsize-xpic+i
     do j=1,ypic
       jj=ysize-ypic+j
       picture(i1,ii,jj) = char(0)
       picture(i2,ii,jj) = char(255)
       picture(i3,ii,jj) = char(0)
     enddo
   enddo
   xpos = 200
   ypos = 200
   call display_dib_block@ (xpos,ypos, picture,xsize,ysize, xsize-xpic,ysize-ypic, xpic,ypic, func,mode,errcode)
   call sleep@(0.5)
!
   deallocate (picture)
   write (*,*) 'end of test', func,mode,errcode
   write (*,*) ' '
!
  end subroutine dibblocktest
Back to top
View user's profile Send private message
Chemie



Joined: 07 Mar 2015
Posts: 49

PostPosted: Thu Jul 14, 2016 4:08 pm    Post subject: Re: Reply with quote

John,
thank you for testing display_dib_block@. I have tested with xpos,ypos = 0 and 1, but the effects are the same.
When you replace in your testprogram the i-loop (do i = 5000,50000,2500) e.g.(there are many combinations of xsiz and ysize, which give the same results) by
xsize=49152 and
ysize= 65536
the program don't crashes, but the lower right corner is black instead of green.

With the 64bit compiler I can now allocate large pictures (I have tried up to 14 gb, my pc has 16 gb ram) but I can't display them correct, when they are greater than 2gb. Sometimes (depending of the size) there will be wrong colours, sometimes there is a crash.
This is (for me) the status now. When I can allocate such large pictures, I want also to display them.
Perhaps, you have a solution for this problem.
Many Thanks
Chemie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Jul 14, 2016 5:06 pm    Post subject: Reply with quote

I have looked at this and I think that the error is in the program.
I am guessing that the %gr pixel sizes (wxh) should be the same values as those used to allocate "picture".

You increase the size to (50000, 50000) and then pass (49000,49000) to display_dib_block@ as position coordinates. I am guessing that you are writing to memory that has not been allocated by Clearwin+.

The control variable associated with %lw can be integer*4. It's not a Windows handle.
Back to top
View user's profile Send private message AIM Address
Chemie



Joined: 07 Mar 2015
Posts: 49

PostPosted: Fri Jul 15, 2016 9:09 am    Post subject: Re: Reply with quote

Paul,
I don't understand display_dib_block@. I have copied the lower right corner (Position(49000,49000) to a fixed picturearray(1000,1000) and display this array with display_dib_block@, all is well. That means, allocation is good, I can write to the array and read from the array, correctly.
My Question: why I can't display an arbitrary part from a large picturearry? For the upper left corner it is going well, why not for the lower right corner?
What is the error in the program?
Thanks for your help.
Chemie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Jul 15, 2016 11:01 am    Post subject: Reply with quote

OK. I have looked at this in more detail and yes you are right again.
An internal calculation in display_dib_block@ is giving an integer overflow.
I have fixed this and I will let you know when I have uploaded a new set of DLLs.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Sat Jul 16, 2016 7:31 am    Post subject: Reply with quote

Here is a link to download a new set of DLLs.
Please remember to keep a backup of the original release.

https://www.dropbox.com/s/iuq2riwhfzahbl7/newDLLs1.zip?dl=0
Back to top
View user's profile Send private message AIM Address
Chemie



Joined: 07 Mar 2015
Posts: 49

PostPosted: Sat Jul 16, 2016 9:44 am    Post subject: Re: Reply with quote

PaulLaidler wrote:
Here is a link to download a new set of DLLs.
Please remember to keep a backup of the original release.

https://www.dropbox.com/s/iuq2riwhfzahbl7/newDLLs1.zip?dl=0


Paul, thank you for the new set of DLLs. Now it is working, I have loaded, allocated and displayed a 13,5 gb picture. All is well.
Thanks
Chemie
Back to top
View user's profile Send private message
Chemie



Joined: 07 Mar 2015
Posts: 49

PostPosted: Mon Jul 25, 2016 12:09 pm    Post subject: Re: Reply with quote

Paul,
perhaps I have found another problem with large (>2gb) files. When I try to read such a *.bmp file with get_dib_block@, I get a crash. With a *.jpg File, the file was read, but the colours are not correct, I think, with other values of width and deepth there will be also a crash. Could it be, that there is the same error as with display_dib_block@?
It is no problem for me (but perhaps for others), because I have my own bmpread-procedure and jpg-files I can transform in bmp-files.

Thanks
Chemie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Jul 25, 2016 12:35 pm    Post subject: Reply with quote

Thank you. I have now located and fixed two similar bugs in get_dib_block@.
Back to top
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Tue Jul 26, 2016 4:30 pm    Post subject: Reply with quote

is there a new set of interim dll's uploaded including this fix ?


let me congratulate Silverfrost on their flexibility in making such intermediate releases of dlls for fixing specific problems raised, it's an excellent example of co-operation and appreciation with the user community.

just a question regarding these interim dll releases - are they each one-off for specific problems aìor are they 'cumulative'.
I only ask because there are 2 already made on this post 11_7 and 13_7 and a later one was also done on 17_7 post 3290 ( relating to G format).
maybe it would be a good idea to keep a 'register' somewhere on the forums where a list of interim updates could be viewed and where to download them /at the moment it depends on you reading ALL the posts to see if there are any temporary fixes released.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Jul 26, 2016 5:05 pm    Post subject: Reply with quote

The fixes are cumulative so you only need the latest one.
I didn't upload the latest fix. If anyone, other than Chemie, experiences the fault then please let me know.
Back to top
View user's profile Send private message AIM Address
Chemie



Joined: 07 Mar 2015
Posts: 49

PostPosted: Sat Jul 30, 2016 10:45 am    Post subject: Re: Reply with quote

Once more to get_dib_block@ (and also to put_dib_block@): Is it possible to insert a further, optional parameter, which indicates the progress of loading (saving) and could be presented by %br? When I load a 9gb bmpfile, I have to wait on my pc ca. 30 seconds and then it was good, to see that the pc is loading.
Thanks
Chemie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
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