Images and printing....

Tereza Snyder tereza at attainmentcompany.com
Sat May 10 20:03:01 EDT 2003


on 05.10.03 10:07 AM, David Bovill wrote:

> I'm doing some work on printing from MC for the first time and got some
> questions:
> 
<snip>

> I've also come across some problems with printing JPEG's from a Sony Digital
> camera... it seems that PictureGear which comes with the Viao range of PC's
> saves the images in a way in which MC can display them but not print them. I
> only used PictureGear to rename the files but the original prints fine the
> renamed files result in blank cards (only the border prints), and using
> something like Graphic Converter on the file which would not print fixes the
> problem.
> 
>

I had a similar problem in  a recent project, which might give you a
direction to go in your case. I was saving jpegs from MetaCard, but they
weren't printing at the right size in other programs (a dpi issue). We
discovered that MetaCard doesn't fill in the "xdensity" and "ydensity" (dpi)
fields of the jpegs that it saves.

I wrote a little utility to read the jpeg header, and correct the problem.
I'll send you the stack if you like, but the important script is this:


on mouseUp
  LOCAL  tmp,N, tfilename
  LOCAL t1 ,t2 ,t3 ,t4 ,t5 ,t6 ,t7 ,t8 ,t9
  
  set the itemdelimiter to "/"
  put  fld 1 of grp "fileName" into tfilename
  
  open file tfilename for binary read
  read from file tfilename  for 20
  close file tfilename
  put it into tBytes
  put offset( "JFIF" , tBytes)+7  into tOffset
  
  get  binaryencode( "C1n1n1", 1, 72, 72 )
  put it into char tOffset to tOffset + length(it) -1 of tBytes
  
  put tBytes into fld "raw"
  
  put binarydecode( "H4H4S1a5H4C1S1S1H*", tBytes, t1 ,t2 ,t3 ,t4 ,t5 ,t6 ,t7
,t8 ,t9 ) into tmp
  put tmp into fld  1 of grp "numRead"
  put 1 into N
  repeat for each word W in "SOI APP0 Length Identifier Version Units
Xdensity Ydensity etc"
    do "put t" & N && "into fld 1 of grp" & quote & W & quote
    add 1 to N
  end repeat
  
  open file tfilename for binary update
  write tBytes to file tfilename
  close file tfilename
end mouseUp


It reads the header, adds the density data, fills in some fields on the card
from the header data so I can check that it's right, then writes the header
back to the file. You could look at your jpegs and see if there's something
different between printing and non-printing ones, and maybe correct the
problem in MetaCard.

tereza







+ Tereza Snyder 
+ Senior Software Developer
+ Attainment Company, Inc.
+ <www.attainmentcompany.com>
+ 800.327.4269




More information about the metacard mailing list