Hi, unfortunately the reading discrepancy of png-files are not corrected from version 8.05 to 8.10. Here is my testprogram once more:
winapp
program pngtest
use mswin
implicit none
integer*4 xsize,ysize,a,imagectrl,picsizex,picsizey,urlmode
integer*4 func,mode,nbbp,urlerror,sizeerrcode,allocerror,blockerrcode,displayerrcode
character*255 filename,url
character*1, dimension(:,:,:), allocatable :: picture
xsize=1200
ysize=900
urlmode=1
url='http://tile.openstreetmap.org/15/16515/12525.png'
filename='test.png'
call read_url@(url,filename,urlmode,urlerror)
a=winio@('%ca[test]&')
a=winio@('%gr&',xsize,ysize)
a=winio@('%lw',imagectrl)
a=use_gdiplus_image_files@(1)
call get_dib_size@(filename,picsizex,picsizey,nbbp,sizeerrcode)
allocate(picture(3,picsizex,picsizey),stat=allocerror)
call get_dib_block@(filename,picture,picsizex,picsizey,0,0,picsizex,picsizey,0,0,blockerrcode)
call display_dib_block@(0,0,picture,picsizex,picsizey,0,0,picsizex,picsizey,func,mode,displayerrcode)
a=winio@('%ca[Result]&')
a=winio@('%nlUrl_error: %wd&',urlerror)
a=winio@('%nlImagesize: %wd %wd&',picsizex,picsizey)
a=winio@('%nlGet_dib_size_error: %wd&',sizeerrcode)
a=winio@('%nlAlloc_error: %wd&',allocerror)
a=winio@('%nlGet_dib_block_error: %wd&',blockerrcode)
a=winio@('%nlDisplay_dib_block_error: %wd&',displayerrcode)
a=winio@('%2nl%cn%9`bt[OK]')
end
The png-file is readed and displayed correct, but the errorcodes are on my PC sometimes not correct. My results are:
URL_error: 0; correct Imagesize: 256x256; correct Get_dib_size_error: 2; (read error) [color=red:b19a95c7de]not[/color:b19a95c7de] correct Alloc_error: 0; correct Get_dib_block_error: 1; [color=red:b19a95c7de]not[/color:b19a95c7de] correct; error 1 is not listed Display_dib_block_error: 0; correct
This is not a severe problem, because the png-file is displayed correctly. But when I ask for the readerror and display an errormessage, this will bot be correct.
Thanks Chemie