Page 1 of 1

Issue on long text using caption

Posted: 2012-02-28T20:39:39-07:00
by xerenader
I have a problem with generating long text in ImageMagick, the text is cut and it doesn't display all the text. Here is my script:

convert -size 1000x -background "#FFFFFF" -font Arial -pointsize 20 -fill "#000000" -gravity west caption:"A wiki (i/ˈwɪki/ wik-ee) is a website whose users can add, modify, or delete its content via a web browser using a simplified markup language or a rich-text editor.[1][2][3] Wikis are typically powered by wiki software and are often created collaboratively by multiple users. Examples include community websites, corporate intranets, knowledge management systems, and notetaking. Wikis may serve many different purposes. Some permit control over different functions (levels of access). For example, editing rights may permit changing, adding or removing material. Others may permit access without enforcing access control. Other rules may also be imposed for organizing content. Ward Cunningham, the developer of the first wiki software, WikiWikiWeb, originally described it as \\\"the simplest online database that could possibly work.\\\"[4] \\\"Wiki\\\" (pronounced [ˈwiti] or [ˈviti]) is a Hawaiian word meaning \\\"fast\\\" or \\\"quick\\\".[5]\n\n A wiki (i/ˈwɪki/ wik-ee) is a website whose users can add, modify, or delete its content via a web browser using a simplified markup language or a rich-text editor.[1][2][3] Wikis are typically powered by wiki software and are often created collaboratively by multiple users. Examples include community websites, corporate intranets, knowledge management systems, and notetaking. Wikis may serve many different purposes. Some permit control over different functions (levels of access). For example, editing rights may permit changing, adding or removing material. Others may permit access without enforcing access control. Other rules may also be imposed for organizing content. Ward Cunningham, the developer of the first wiki software, WikiWikiWeb, originally described it as \\\"the simplest online database that could possibly work.\\\"[4] \\\"Wiki\\\" (pronounced [ˈwiti] or [ˈviti]) is a Hawaiian word meaning \\\"fast\\\" or \\\"quick\\\".[5]\n\n A wiki (i/ˈwɪki/ wik-ee) is a website whose users can add, modify, or delete its content via a web browser using a simplified markup language or a rich-text editor.[1][2][3] Wikis are typically powered by wiki software and are often created collaboratively by multiple users. Examples include community websites, corporate intranets, knowledge management systems, and notetaking. Wikis may serve many different purposes. Some permit control over different functions (levels of access). For example, editing rights may permit changing, adding or removing material. Others may permit access without enforcing access control. Other rules may also be imposed for organizing content. Ward Cunningham, the developer of the first wiki software, WikiWikiWeb, originally described it as \\\"the simplest online database that could possibly work.\\\"[4] \\\"Wiki\\\" (pronounced [ˈwiti] or [ˈviti]) is a Hawaiian word meaning \\\"fast\\\" or \\\"quick\\\".[5]\n\n A wiki (i/ˈwɪki/ wik-ee) is a website whose users can add, modify, or delete its content via a web browser using a simplified markup language or a rich-text editor.[1][2][3] Wikis are typically powered by wiki software and are often created collaboratively by multiple users. Examples include community websites, corporate intranets, knowledge management systems, and notetaking. Wikis may serve many different purposes. Some permit control over different functions (levels of access). For example, editing rights may permit changing, adding or removing material. Others may permit access without enforcing access control. Other rules may also be imposed for organizing content. Ward Cunningham, the developer of the first wiki software, WikiWikiWeb, originally described it as \\\"the simplest online database that could possibly work.\\\"[4] \\\"Wiki\\\" (pronounced [ˈwiti] or [ˈviti]) is a Hawaiian word meaning \\\"fast\\\" or \\\"quick\\\".[5]\n\n A wiki (i/ˈwɪki/ wik-ee) is a website whose users can add, modify, or delete its content via a web browser using a simplified markup language or a rich-text editor.[1][2][3] Wikis are typically powered by wiki software and are often created collaboratively by multiple users. Examples include community websites, corporate intranets, knowledge management systems, and notetaking. Wikis may serve many different purposes. Some permit control over different functions (levels of access). For example, editing rights may permit changing, adding or removing material. Others may permit access without enforcing access control. Other rules may also be imposed for organizing content. Ward Cunningham, the developer of the first wiki software, WikiWikiWeb, originally described it as \\\"the simplest online database that could possibly work.\\\"[4] \\\"Wiki\\\" (pronounced [ˈwiti] or [ˈviti]) is a Hawaiian word meaning \\\"fast\\\" or \\\"quick\\\".[5]" -density 9 text.png

This is my test text:


A wiki (i/ˈwɪki/ wik-ee) is a website whose users can add, modify, or delete its content via a web browser using a simplified markup language or a rich-text editor.[1][2][3] Wikis are typically powered by wiki software and are often created collaboratively by multiple users. Examples include community websites, corporate intranets, knowledge management systems, and notetaking.
Wikis may serve many different purposes. Some permit control over different functions (levels of access). For example, editing rights may permit changing, adding or removing material. Others may permit access without enforcing access control. Other rules may also be imposed for organizing content.
Ward Cunningham, the developer of the first wiki software, WikiWikiWeb, originally described it as "the simplest online database that could possibly work."[4] "Wiki" (pronounced [ˈwiti] or [ˈviti]) is a Hawaiian word meaning "fast" or "quick".[5]

It is copied and pasted 5x.

Thanks in advance.

Re: Issue on long text using caption

Posted: 2012-02-28T23:31:09-07:00
by anthony
Yes I believe there is a current limit (painful though it is) of 4 kbytes in a lot of string handling in IM.

Painful though it is!

Remember IM is mostly written in C and not in language that handle strings of infinite length (like perl).
Unless the programmer puts in a lot of effort to ensure 'infinite strings' can be used, well they simple can't.

It isn't just a matter of input (the string on command lines are just passed), but the percent escape handler that will need to be modified to allow for infinite string handling. It is that handler that would be causing the string to be truncated due to its buffer limits.

As IMv7 will be working with scripts, and pipelines. this type of problem may become more common and as such require to be looked at.

In the mean time you are welcome to have a look at the code to see what can be done, OR point out some module that will improve this type of thing.

Re: Issue on long text using caption

Posted: 2012-02-28T23:53:01-07:00
by xerenader
I'm glad to accept your offer. I'll see if I can contribute something for this issue. Thanks.

Re: Issue on long text using caption

Posted: 2012-02-29T10:32:11-07:00
by fmw42
In the meantime, I believe that you can put your text into a text file and then convert that to an image

convert textfile.txt textfile.gif

Re: Issue on long text using caption

Posted: 2012-02-29T16:22:43-07:00
by xerenader
I'm curios about what will be the features of IM7. Can you give me some features of it so that we can see if it will affect some of the features of our project? Right now we are using 6.7.3-1. Thanks.

Re: Issue on long text using caption

Posted: 2012-02-29T18:19:25-07:00
by anthony
In the meantime, I believe that you can put your text into a text file and then convert that to an image

convert textfile.txt textfile.gif
Sorry fred, all that does is read the text file into a string. You will then have the same buffer limit problems as before.

I will however be sure that script tokenization part has not token limits. Though that does not help in other areas of the library.
xerenader wrote:I'm curios about what will be the features of IM7. Can you give me some features of it so that we can see if it will affect some of the features of our project? Right now we are using 6.7.3-1. Thanks.
Made a separate topic... IMv7 What is Happening...
viewtopic.php?f=1&t=20429#p81541

Re: Issue on long text using caption

Posted: 2012-02-29T18:38:25-07:00
by magick
We have a patch in ImageMagick 6.7.5-8 to permit infinite caption lengths. The patch will be available by sometime tomorrow.

Re: Issue on long text using caption

Posted: 2012-02-29T19:49:00-07:00
by xerenader
Great! I'm looking forward to this. Thanks!

Re: Issue on long text using caption

Posted: 2012-03-05T19:48:17-07:00
by xerenader
I downloaded ImageMagick 6.7.5-8 and tested it but my text is cut just like my previous problem. Why this happens? Thanks

Re: Issue on long text using caption

Posted: 2012-03-05T20:21:24-07:00
by fmw42
Your long text seems to work for me under IM 6.7.5.10 Q16 Mac OSX Snow Leopard. However, it appears to me that it is right justified (-gravity east?) rather than left justified (-gravity west), unless I misunderstand how -gravity is used in caption:

Note I am compiled with PANGO, so that might be an issue regarding the justification. There were some bugs that were just worked out in this last version of IM regarding caption: using PANGO.

Re: Issue on long text using caption

Posted: 2012-03-05T20:45:33-07:00
by fmw42
cabeenly wrote:It is normal for me with ImageMagick 6.7.5-8! :D

Do you mean that you get the correct results also. If so what platform are you using and is IM using PANGO or not?

Re: Issue on long text using caption

Posted: 2012-03-05T22:05:57-07:00
by xerenader
Thanks. It's working now on IM 6.7.5-10