ExtFileFormats.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <?xml-stylesheet type="text/xsl" href="../Xsl/doc2html.xsl"?>
  3. <doc>
  4. <title>File Format Extensions</title>
  5. <chapter>
  6. <title>File Format Extensions</title>
  7. <par>
  8. These extensions allow Imaging to load and save images from/to
  9. files in various formats.
  10. File formats included in Imaging core (that is in
  11. <keyword>Source</keyword> directory) must satisfy these requirements:
  12. both loading and saving support, native crossplatform
  13. Object Pascal implementation, support as many data formats as possible,
  14. be stream safe (you have multiple images in one stream and you load them
  15. one by one without exactly knowing where they start - after loading one
  16. stream position must be precisely at the beginning of another - some
  17. file formats (e.g. Daggerfall images) need to know exact file size during loading so
  18. they are inherently unsafe).
  19. File format loaders/savers that do not meet these requirements are
  20. located in Extras package (<keyword>Extras\Extensions</keyword> directory).
  21. </par>
  22. <par>
  23. Some complex file formats make compiled binaries significantly larger.
  24. Most notably <b>TIFF</b> (around 400 KiB),
  25. <b>JPEG</b> (around 100 KiB), <b>JPEG2000</b> (around 150 KiB), and <b>PNG</b>
  26. (around 50 KiB). Some formats use others internally - <b>MNG</b> and <b>JNG</b> use
  27. PNG and JPEG. If you know you won't be needing some of those formats
  28. and you don't want large binaries you can disable them at compile stage.
  29. This is done by uncommenting <icode>DONT_LINK_*</icode> (where * is file format
  30. identifier) symbols in
  31. <icode>ImagingOptions.inc</icode> include file
  32. located in <keyword>Source</keyword> directory.
  33. All core file formats have corresponding symbols here and all
  34. are enabled by default in this include file.
  35. There is also <icode>DONT_LINK_EXTRAS</icode> symbol that controls
  36. automatic linking with file formats declared in Extras package
  37. (individual <icode>DONT_LINK_*</icode> symbols for these file format can be turned
  38. on/off in <ref>ImagingExtras.pas</ref>
  39. unit located in <keyword>Extras\Extensions</keyword> directory).
  40. </par>
  41. <warn>
  42. In Imaging 0.26.2 file format linking symbols were changed
  43. from <icode>LINK_*</icode> to <icode>DONT_LINK_*</icode>.
  44. So if you used these symbols somewhere in you projects
  45. please check your code if it still works as intended
  46. after 0.26.2 installation.
  47. <br/>
  48. Why did it change?<br/>
  49. Since all formats are enabled by default in Imaging releases,
  50. if you wanted to disable one format you had to manually edit
  51. <icode>ImagingOptions.inc</icode> and comment out appropriate
  52. <icode>$DEFINE</icode> statement.
  53. So there was a problem when you had more projects using the same
  54. Imaging installation and each wanting to use different subset of file formats.
  55. With new symbols you don't have to edit the include file at all,
  56. just add <icode>DONT_LINK_*</icode> to "Conditional defines" (or its Lazarus equivalent)
  57. in compiler options of each project.
  58. </warn>
  59. <linklist>
  60. <title>More on supported file formats</title>
  61. <lslink url="../FileFormats/FileFormats.xml">Supported File Formats</lslink>
  62. </linklist>
  63. </chapter>
  64. </doc>