|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Wed Jul 13, 2016 7:08 am Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
|
Back to top |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Thu Jul 14, 2016 8:55 am Post subject: Re: |
|
|
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(:,:,, 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 |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Thu Jul 14, 2016 1:22 pm Post subject: |
|
|
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 |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Thu Jul 14, 2016 4:08 pm Post subject: Re: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Jul 14, 2016 5:06 pm Post subject: |
|
|
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 |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Fri Jul 15, 2016 9:09 am Post subject: Re: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Fri Jul 15, 2016 11:01 am Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
|
Back to top |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Sat Jul 16, 2016 9:44 am Post subject: Re: |
|
|
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 |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Mon Jul 25, 2016 12:09 pm Post subject: Re: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Mon Jul 25, 2016 12:35 pm Post subject: |
|
|
Thank you. I have now located and fixed two similar bugs in get_dib_block@. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Tue Jul 26, 2016 4:30 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue Jul 26, 2016 5:05 pm Post subject: |
|
|
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 |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Sat Jul 30, 2016 10:45 am Post subject: Re: |
|
|
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 |
|
|
|
|
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
|