using-images.mdwn 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Intro
  2. Some file types are not handled well by certain version control systems. Many
  3. version control systems aren't made to handle large or binary files, and don't
  4. know how to handle their versions other than keep each version in the history.
  5. For some file types, even if not large or text based, version control in the
  6. wiki doesn't make much sense, and they may be treated like binary files.
  7. One such kind of files is __images__. There are two kinds of image encoding:
  8. 1. Vector graphics
  9. 2. Raster graphics
  10. Vector graphics are usually published as text-based SVG files. Git can handle
  11. them and display changes, but since Partager is not an image editing project,
  12. the development of the SVGs doesn't happen here and the version control isn't
  13. very useful. If a file is changed, there's a good chance it's a big change with
  14. a long diff, or even a whole new image, not based on the previous one.
  15. Raster graphics are binary data, usually compressed. JPG is popular for
  16. pictures taken by a camera, and PNG is popular for computer-generated images.
  17. # Formats
  18. Always use free open formats. The preferred formats are:
  19. - SVG for vector graphics
  20. - PNG for computer-generated raster images
  21. - JPG for camera-made pictures
  22. - Dia/ODG/dot for diagrams
  23. - For image sources, you can upload the XCF source files Gimp uses
  24. # Where to Upload
  25. When uploading a single small image, pushing it to git is fine. Diagrams can go
  26. to git too, since their development usually happens in the wiki. Otherwise,
  27. prefer to store them outside version control.
  28. This wiki uses an [underlay](https://ikiwiki.info/plugins/underlay) which can be
  29. accessed via HTTP and FTP. The clearnet address is <http://files.partager.null>.
  30. The *wiki* folder is the underlay.
  31. __Note:__ Currently there is no upload access yet. Only public read access. If
  32. you want to upload something to the underlay, send it to me and I'll put it
  33. there. You don't have to wait - just put a link on the relevant pages as usual,
  34. and the links will be dead until I upload the file - when I do, they will start
  35. working. This way you won't have to wait for me. Another option is to store
  36. the image somewhere else for now, e.g. a MediaGoblin instance.
  37. [[TODO|TODO/OPEN]] enable HTTP/S-with-password upload and/or SFTP upload and/or
  38. FTP/S-with-password and/or Kerberos or something.
  39. In the underlay, put the image in the *images* folder, e.g.
  40. *files.partager.null/wiki/images/hello.svg*, or in a subfolder corresponding to
  41. the section which uses it. For example, if an image is uploaded to be used as an
  42. attachment to the page *tutorials/gnupg.mdwn*, you can put it at
  43. *wiki/tutorials/gnupg/image.png* and then simply use `\[[image.png]]` in the
  44. page (or the [[ikiwiki/directive/img]] plugin).
  45. # How to Embed in a Page
  46. A [[ikiwiki/WikiLink]] to an image embeds it in full-size, e.g.
  47. \[[image.png]]
  48. For more flexibility and options, you can use the [[ikiwiki/directive/img]]
  49. directive, e.g.
  50. \[[!img image.png size=200x600]]
  51. If you want to center the image horizontally, set the class to "center", e.g.
  52. \[[!img image.png size=200x600 class="center"]]
  53. For other alignments to work, e.g. right alignment or vertical alignment, the
  54. [[CSS]] needs to be edited. You can e.g. add an *img.right* class in a similar
  55. way to the *img.center* class defined at the bottom of *local.css*.