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 

DIB_BLOCK limits
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Norm.Campbell



Joined: 31 Aug 2007
Posts: 66

PostPosted: Mon Sep 16, 2013 1:17 pm    Post subject: Reply with quote

Based on comments in a post on "Problem Displaying JPG File", I wrote some simple code to read a JPG file:

program Flinders_video_data_jpg_read_v01

include <windows.ins>

character *1 ch_rsp

character *180 flnm

character, Allocatable :: ch_refl_P_L ( : , : , : )

flnm = 'CH201201_062_060028_P_1358_PS.jpg'

call GET_DIB_SIZE@ ( flnm,
1 npxl, nlne,
2 nbpp, nerr )

write ( 6, '(/ '' jpeg width, height, # bytes : '', 3i6 )' )
1 npxl, nlne, nbpp

Allocate ( ch_refl_P_L ( 3, npxl, nlne ) )

nzr = 0

nerr = 0

call GET_DIB_BLOCK@ ( flnm, ch_refl_P_L,
1 npxl, nlne,
2 nzr, nzr,
3 npxl, nlne,
4 nzr, nzr, nerr )

The code returns 0s for npxl and nlne, and 24 for # bytes (the latter is correct). The actual values are 3168 L x 4752 P.

When I read the file into Photoshop and export it, the PS-exported file reads correctly.

Any suggestions?

Paul, can I email the file to you (~ 6 MB) so that you can find out why GET_DIB_SIZE is returning 0s?

Norm
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Tue Sep 17, 2013 1:15 am    Post subject: Reply with quote

Norm,

The two main advances that have occured with this thread is
1) the increase in size limit for DIB blocks to above 2048, and
2) the inclusion of .png formats to replace .gif

I am not sure at what version of FTN95 this occurred, as I had a look in cwplus.enh, but could not find it documented.

You should check which version of ftn95 you have as the error you are finding could be associated with the 2048 size limit.

John

PS: I have adapted the sample program I provided earlier and it failed for get_dib_size@ for a large .jpg file.
The error mesaage was:
"Curly bracket/integer form is not available in this context" ??
I will email the test problem.
Back to top
View user's profile Send private message
Norm.Campbell



Joined: 31 Aug 2007
Posts: 66

PostPosted: Tue Sep 17, 2013 10:58 pm    Post subject: Reply with quote

Thanks John

I'm in the process of upgrading to the latest version.

But it's interesting that the code runs fine on the Photoshop-exported version of the same file. This makes me think that it is something to do with the interaction with the internal file structure, and not necessarily the size per se.

Norm
Back to top
View user's profile Send private message
Norm.Campbell



Joined: 31 Aug 2007
Posts: 66

PostPosted: Wed Sep 25, 2013 7:43 am    Post subject: reading jpeg file Reply with quote

I've now installed the very latest Fortran version, but the main problem persists.

The code now returns 4752 and 3168 for npxl and nlne (0 previously), and 24 for # bytes (these are correct).

However, it gives error code 2 when trying to read the actual byte values.

Paul, can I email the file to you (~ 6 MB) so that you can find out why GET_DIB_BLOCK is not reading the correct values?

Remember that the code runs when I use a Photoshop-exported version of the same file.

Norm
Back to top
View user's profile Send private message
Norm.Campbell



Joined: 31 Aug 2007
Posts: 66

PostPosted: Sun Sep 29, 2013 11:53 pm    Post subject: Reply with quote

Paul

I've sent the file again.

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


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

PostPosted: Mon Sep 30, 2013 4:30 pm    Post subject: Reply with quote

ClearWin+ does not recognise the header of this jpg file.

If I open the file in Microsoft Paint and "Save As" a different jpg file then the header is changed and is now recognised by ClearWin+.

If I allow the original header in ClearWin+ then this simply delays the failure till the data is processed.

So although the file is accepted as valid by Microsoft Paint, it does not have a form that can be processed by ClearWin+ at the moment.

In the longer term it may be possible to update the jpeg handling code in ClearWin+ using the same approach as the new code for png files. Hopefully this would fix the problem.

In the mean time it will be necessary to process files of this kind so that the header is accepted by ClearWin+.
Back to top
View user's profile Send private message AIM Address
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Tue Oct 01, 2013 12:14 pm    Post subject: Reply with quote

Paul and Norm,
I had the same problem a while ago for photos taken with a Konica Minolta camera. The solution was similar, but I used the batch processing facility of Irfanview to modify the files in bulk.
Ian
Back to top
View user's profile Send private message Send e-mail
Norm.Campbell



Joined: 31 Aug 2007
Posts: 66

PostPosted: Tue Oct 01, 2013 12:50 pm    Post subject: Reply with quote

Thanks Ian

That's good to know, as I have 400+ photos to run through the illumination-adjustment code that I've written.

I was going to hassle Paul about trying to get something done sooner rather than later, as I couldn't face loading in the images one-at-a-time, but now I'll use your solution.

Norm
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 -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
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