Page 1 of 1

msl and wordwrapped annotation (caption:)

Posted: 2009-09-14T13:37:10-07:00
by keesk
Hi,

New to this and i have a hard time finding documentation on MSL.

How do i use the caption: option in an MSL script? can i use the gravity option with it too?
I tried something like this but it doesn't wordwrap.

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
  <group>
      <image id="picture">
          <read filename="http://rsportscars.com/foto/12/amdbs08_01.jpg"/>
	      <frame geometry ="10x10+4+4" fill="red"  />
          <resize geometry="500x700"/>
      </image>
      <image id="title" size="1500x100" >
           <read filename="xc:transparent" />
           <annotate pointsize="75" x="75%" y="75%" fill="darkcyan" text="This line of text has to fit in the box i just created!" />
      </image>
      <image id="canvas" size="1600x900">
          <read filename="xc:#000000" />
          <composite image="picture" geometry="+50+150"/>
          <composite image="title" geometry="+50+10"/>
      </image>
      <write filename="folder.jpg"/>
  </group>



Greetings,

Kees

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-14T17:22:10-07:00
by magick
You'll need ImageMagick 6.5.6-1 (available in a week or so):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
  <group>
      <image id="picture">
          <read gravity="center" pointsize="32" size="200x" filename="caption:Image Magick"/>
      </image>
      <write filename="image.jpg"/>
  </group>

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-15T10:53:17-07:00
by keesk
magick wrote:You'll need ImageMagick 6.5.6-1 (available in a week or so):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
  <group>
      <image id="picture">
          <read gravity="center" pointsize="32" size="200x" filename="caption:Image Magick"/>
      </image>
      <write filename="image.jpg"/>
  </group>

Ok downloaded 6.5.6-1 (great support), wordwrap works, i can set the background color but how to set the fill color ?

Code: Select all

      <image id="title" background="#101010" size="1500x120" >
	            <read gravity="center"  filename="caption:This a test 1234567890 0987654321 aa bb cc dd ee ff gg  word wrap works" />
	  </image>


Btw, is there a way to list all options and there atributes for the MSL ?

There are several "writing text" options where to find which one is best for what use ?
Is caption the only text option supporting wordwrap ?


Great tool!

Kees

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-15T11:14:35-07:00
by magick
Take a look http://www.imagemagick.org/script/perl-magick.php. MSL is designed to support any method / attribute supported by PerlMagick. However since there has not been much demand for MSL we have not completed the full gamut of methods / attributes and instead add support if a user asks. We do have solving this problem on our list of things to do without an ETA at this time. For now, if you need an method / attribute supported, let us know.

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-15T14:06:25-07:00
by keesk
see my modified reply, how to set the fill color of the fonts.


maybe it's possible to set one of the other text methods to have an atrribute called wordwrap="[true|false]"

thanks for the link

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-15T18:06:35-07:00
by magick
Grab ImageMagick 6.5.6-2 from ftp://ftp.imagemagick.org/pub/ImageMagick/beta sometime tomorrow. It supports the fill option. We set up a new method where we can eventually support all the various options as time permits.

Regarding word wrap. Captions wrap (e.g. caption:) and labels do not (e.g. label:). See http://www.imagemagick.org/Usage/text/#caption.

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-21T13:00:54-07:00
by keesk
Hi,

downloaded the .2 (zip) today and it did not work.

checked the -version and it showed the .1 versionnumber

downloaded an other type of install, this one also showed .1 versionnumber

i cannot compile myself so please provide me with the correct version.

thanks in advance.

Greetings,

Kees

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-21T15:44:18-07:00
by magick
We assume you are running under Windows? If so, we will get an updated binary out by the end of this week.

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-21T21:52:14-07:00
by keesk
yep running windows (7)

thanks for updating

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-21T22:07:20-07:00
by keesk
can you give me a working example on how to use the fill command ?

this does not work no error:
<image id="title" background="#101010" fill="#101000" size="1500x120" >

this does not work get error:
<read gravity="center" fill="#101000" filename="caption:This a test" />


voor info afterr downloading and extracting .3:

M:\im\ImageMagick-6.5.6-3>conjure -version
Version: ImageMagick 6.5.6-4 2009-09-21 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-22T06:44:07-07:00
by magick
We have a fix for the problem. Look for an update to the Windows binaries by sometime tomorrow. We intend to support all the standard attributes (e.g. fill, stroke, etc) from the image, set, read, or write tags in the near future.

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-22T11:30:12-07:00
by keesk
thanks again, i'm sorry im bugging you with these questions.

it's hard to understand the msl with so little documentation, why are some settings attributes of the image-tag, some are part of the read tag and some are part of the filename attribute.

it's like a crossword pick it up look at it try something put it back pick it up, think again etc :-)


Greetings,

Kees

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-22T12:15:56-07:00
by magick
Its just a matter of convenience. You can set the global attributes in any of these tags but it makes the most sense to set them in the read tag if that is where you are using them. However, not all the attributes are coded just yet (see http://www.imagemagick.org/script/perl- ... -attribute).

In regards to documentation. There is more work than we can possibly finish in a lifetime so we mostly work on activities associated with ImageMagick that are in demand. There has been little interest in MSL so there has been little activity. However, we do intend to finish up the setting and getting of the complete set of image attributes within the next week or so.

Re: msl and wordwrapped annotation (caption:)

Posted: 2009-09-23T11:59:50-07:00
by keesk
Thanks,

It works for now (for what i want).

Can't set font or pointsize but i'll wait until the next release in with the improvements you mentioned.

Just for info: I read the caption wit @filename from an utf-8 textfile and it always starts with a questionmark before the first character, non utf-8 files breaks at the first "strange" character. (é)


Keep up the good work.