Hall Of Shame
 
StartSeite | Neues | TestSeite | ForumSeite | Teilnehmer | Kategorien | Index | Hilfe | Einstellungen | Ändern

Veränderung (zum vorhergehenden Autor) (Änderung, Korrektur, Normalansicht)

Verändert: 15c15
:Hast du auch dies hier gesehen? ==>
:Hast du auch dies hier gesehen? ==> RTF/AnmerkungBilder -- VolkerGlave

Verändert: 17,103c17
<pre>
"Images in RTF"

In the RTF Pocket Guide's section on "Embedding Images", I say this:

In an ideal world, RTF would allow you to insert a picture into a
document by simply dropping a hex-encoded GIF, JPEG, or PNG file into
your RTF code. But RTF doesn't do things that way. The RTF
specification, on the subject of pictures, explains a {\pict...}
construct that contains picture data (typically as a long series of
hexadecimal digits).

And the crucial sentence:

But the picture data encoded in the {\pict...} construct is in a binary
format that can't be converted to easily from a conventional image
format (i.e., GIF, JPEG, or PNG).

The binary format that I'm talking about is actuall WMF (Windows
Metafile), incidentally -- whenever I'd try dropping a gif into a
document and the examining how it saved, it'd be encased in inscrutible
WMF code (or, even worse, MSWord-specific binary formats). One can,
I'm sure, convert GIF to WMF, but not easily.

But a reader of mine, Dave Thielen, has pointed out to me something that
totally escaped me, my experienced tech-editors, and everyone
else I've ever asked about this (and I asked far and wide) -- namely,
that the contents of a {\pict...} construct CAN be in an WMF, OR
they can be in JPG or PNG (and a few other uninteresting formats
besides). That is, whereas you can't dump raw GIF data into a \pict
construct, you CAN dump raw JPG/PNG data in -- encoded as hex data,
and prefaced by the image heigh and width.

(Actually, you can use unencoded data as part of a \binN keyword, but
this is probably a bad idea for various minor pragmatic reasons, and is
in any case not covered in the book.)

Specifically, you use {\pict\jpegblip\picwX\pichY...} or
{\pict\pngblip\picwX\pichY...} where X is the image's width in pixels
and Y is the image's height in pixels. The content is simply hex
encoded. I suggest adding a newline every so often -- I like adding
one every 64 characters, and maybe even before and after the data
as a whole.

This approach is demonstrated by the rtf_image_embed_sample.pl program
in this directory, and its sample input files hypnocat.jpg and
hypnocat.png, and output files hypnocat_jpg.rtf and hypnocat_png.rtf.

You can stick other, optional, commands between the \pichY and the
picture data. Consult the RTF specification's section "Pictures"
for all the gory details, but here's a quick reference to the
eight interesting ones:

\picwgoalN
Desired width of the picture, in twips.
\pichgoalN
Desired height of the picture, in twips.

\picscalexN
Horizontal scaling value. The N argument is a value representing a
percentage (the default is 100 percent).
\picscaleyN
Vertical scaling value. The N argument is a value representing
a percentage (the default is 100 percent).

\piccroptN
\piccropbN
\piccroprN
\piccroplN
The top, bottom, right, and left cropping values, in twips.
A positive value crops toward the center of the picture; a negative
value crops away from the center, adding a space border around the
picture (the default value is 0).

Remember, that's just quick reference; the spec is more detailed, mostly
for options that used only with embedding image types other than PNG and
JPG.
</pre>

Gefunden in http://examples.oreilly.com/rtfpg/
dies wiederum gefunden auf http://www.oreilly.com/catalog/rtfpg/
dies wiederum gefunden auf http://search.cpan.org/~sburke/RTF-Writer-1.11/lib/RTF/Cookbook.pod
dies wiederum gefunden auf http://search.cpan.org/~sburke/RTF-Writer-1.11/
dies wiederum gefunden auf http://search.cpan.org/~sburke/
dies wiederum gefunden auf http://interglacial.com/~sburke/
dies wiederum gefunden auf http://groups.google.de/groups?selm=e7m43503DHA.1636@TK2MSFTNGP12.phx.gbl
dies wiederum gefunden per Google-Groups-Suche nach "html2rtf". -- VolkerGlave
Ja, ich kenn die Stelle, aber ich glaube nicht, dass diese Andeutungen tragen. Das Problem ist bekannt und lästig. Es würde Anwendungs-Beispiele im Netz dazu geben. Ich würde mir aber wünschen, dass ich mich irre. -- HelmutLeitner

Lustig zu lesen ... und man kann sich auch an der eigenen Nase fassen :-)

RTF Format ohne Kompression für Bilder

Bei der kürzlichen Beschäftigung mit dem RTF-Format (mit dem Ziel HTML- und Wiki-Seiten in RTF zu konvertieren und downloadbar zu machen) musste ich feststellen, dass dieses Format keine Kompression für die im Text enthaltenen Bilder unterstützt. Zusammen damit, das Bytes als 2-stelliges Hex codiert werden, blähen sich Dateien mit Bildmaterial auf das 10-30-fache Volumen auf. Dateien mit einigen 0.1-1 GB sind so keine Seltenheit. Zumindest ein simples RLE-Verfahren wäre kinderleicht zu implementieren gewesen und hätte diese Situation entspannt. Besser wäre die binären Abbildung der Originalfiles im Text. RTF existiert schon lange und mittlerweile in Version 1.7, das Problem muss bekannt sein, genug Zeit das zu implementieren. Schande über die Leute, die für dieses Format zuständig sind. -- HelmutLeitner

Habe oberflächlich in eine RTF-Spezifikation hineingeschaut. Danach hätte ich vermutet, dass das Gewünschte geht. ("An RTF file can include pictures created with other applications. These pictures can be in hexadecimal (the default) or binary format. [...] \pngblip | \jpegblip [...]"). Aber tut es ja anscheinend nicht. -- VolkerGlave

Mir ist es gleich gegangen. Beim Recherchieren bin ich jedoch auf keinen Hinweise oder Beispiele gestoßen, die diese Lesart unterstützen. Wobei ja noch die Unklarheit besteht, dass "binary" nicht unbedingt "raw file content" heißen muss. Sollte es doch möglich sein, komprimierte Files in hex oder binary einzufügen, dann kann es nur jemand mit Insider-Informationen und es hat sich nicht herumgesprochen. In dem Fall würde ich ihnen "Unfähigkeit bei der Dokumentation wesentlicher Funktionalität" vorwerfen. Im übrigen bietet RTF noch viele Ansätze für Kritik, sowohl von der Implementierung, als auch von der Dokumentation her. Je mehr ich mich damit beschäftige, desto mehr ärgere ich mich darüber. Die Erzeugung von Listen und Tabellen ist der blanke Wahnsinn. -- HelmutLeitner

Hast du auch dies hier gesehen? ==> RTF/AnmerkungBilder -- VolkerGlave

Ja, ich kenn die Stelle, aber ich glaube nicht, dass diese Andeutungen tragen. Das Problem ist bekannt und lästig. Es würde Anwendungs-Beispiele im Netz dazu geben. Ich würde mir aber wünschen, dass ich mich irre. -- HelmutLeitner


StartSeite | Neues | TestSeite | ForumSeite | Teilnehmer | Kategorien | Index | Hilfe | Einstellungen | Ändern
Text dieser Seite ändern (zuletzt geändert: 17. April 2004 8:17 (diff))
Suchbegriff: gesucht wird
im Titel
im Text