You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.0 KiB

  1. .. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
  3. :alt: License: LGPL-3
  4. ================================
  5. DarkroomJS Image Editing for Web
  6. ================================
  7. This module provides a `DarkroomJS`_ (v2.0.1) web widget for use with image
  8. fields. It also adds a Darkroom button to the normal image widget, which can
  9. be used to edit the image via Darkroom in a modal.
  10. .. _DarkroomJS: https://github.com/MattKetmo/darkroomjs
  11. The widget currently supports the following operations and can be extended to
  12. allow others:
  13. * Zoom and pan
  14. * Rotate
  15. * Crop
  16. * Step back in history client-side (before save)
  17. Usage
  18. =====
  19. After installing the module, you can use it in the following ways:
  20. * Specify the ``darkroom`` widget when adding an image field to a view.
  21. Configuration values can be provided using the ``options`` attribute::
  22. <field name="image" widget="darkroom" options="{'minWidth': 100}"/>
  23. The widget passes options directly through to DarkroomJS, which supports the
  24. following:
  25. * minWidth
  26. * minHeight
  27. * maxWidth
  28. * maxHeight
  29. * ratio (aspect ratio)
  30. * backgroundColor
  31. * Open a form view that contains an image in edit mode and hover over the
  32. image widget. You should see a Darkroom button that can be clicked to open
  33. the image in a Darkroom modal, where it can be edited and the changes can be
  34. saved.
  35. .. image:: /web_widget_darkroom/static/description/modal_screenshot_1.png
  36. :alt: Darkroom Modal Screenshot 1
  37. :class: img-thumbnail
  38. :height: 260
  39. .. image:: /web_widget_darkroom/static/description/modal_screenshot_2.png
  40. :alt: Darkroom Modal Screenshot 2
  41. :class: img-thumbnail col-xs-offset-1
  42. :height: 260
  43. Known Issues / Roadmap
  44. ======================
  45. * Darkroom modals are currently not supported during record creation
  46. * Fabric.js >= 1.70 is not currently supported by DarkroomJS
  47. (`MattKetmo/darkroomjs#112 <https://github.com/MattKetmo/darkroomjs/issues/112>`_)
  48. Bug Tracker
  49. ===========
  50. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. In
  51. case of trouble, please check there if your issue has already been reported.
  52. If you spotted it first, help us smash it by providing detailed and welcome
  53. feedback.
  54. Credits
  55. =======
  56. Images
  57. ------
  58. * Odoo Community Association:
  59. `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  60. Contributors
  61. ------------
  62. * Dave Lasley <dave@laslabs.com>
  63. * Oleg Bulkin <obulkin@laslabs.com>
  64. * Brent Hughes <brent.hughes@laslabs.com>
  65. Maintainer
  66. ----------
  67. .. image:: https://odoo-community.org/logo.png
  68. :alt: Odoo Community Association
  69. :target: https://odoo-community.org
  70. This module is maintained by the OCA.
  71. OCA, or the Odoo Community Association, is a nonprofit organization whose
  72. mission is to support the collaborative development of Odoo features and
  73. promote its widespread use.
  74. To contribute to this module, please visit https://odoo-community.org.