<commit_before>---
title: "EAS_Produce"
layout: config
menu:
  main:
    name: "EAS-Produce"
    identifier: "sysadmin/konfiguration/easydb-server.yml/produce"
    parent: "sysadmin/konfiguration/easydb-server.yml"
easydb-server.yml:
  - eas.rights_management.image.versions[].<class>.size_print
  - eas.rights_management.image.versions[].<class>.size_limit
  - eas.rights_management.image.versions[].<class>.export
  - eas.rights_management.image.versions[].<class>.rightsmanagement
  - eas.rights_management.image.versions[].<class>.group
  - eas.rights_management.image.versions[].<class>.zoomable
  - eas.rights_management.video.versions[].<class>.version
  - eas.rights_management.video.versions[].<class>.size_print
  - eas.rights_management.video.versions[].<class>.size_limit
  - eas.rights_management.video.versions[].<class>.export
  - eas.rights_management.video.versions[].<class>.group
  - eas.rights_management.video.versions[].<class>.rightsmanagement
  - eas.rights_management.video.versions[].<class>.standard
  - eas-rights_management.audio.versions[].<class>.version
  - eas-rights_management.audio.versions[].<class>.size_print
  - eas-rights_management.audio.versions[].<class>.export
  - eas-rights_management.audio.versions[].<class>.rightsmanagement
  - eas-rights_management.audio.versions[].<class>.group
  - eas-rights_management.audio.versions[].<class>.standard
  - eas-rights_management.office.versions[].<class>.version
  - eas-rights_management.office.versions[].<class>.size_print
  - eas-rights_management.office.versions[].<class>.export
  - eas-rights_management.office.versions[].<class>.rightsmanagement
  - eas-rights_management.office.versions[].<class>.standard
  - eas-rights_management.archive.versions[].<class>.version
  - eas-rights_management.archive.versions[].<class>.size_print
  - eas-rights_management.archive.versions[].<class>.group
  - eas-rights_management.archive.versions[].<class>.rightsmanagement
  - eas-rights_management.archive.versions[].<class>.limit
  - eas-rights_management.archive.versions[].<class>.standard
  - eas-rights_management.unknown.versions[]
  - eas-rights_management.vector2d.versions[]
  - eas-rights_management.vector3d.versions[]
---
# File size for download and preview

For each asset (picture, document, etc.) easydb provides automatically calculated variants of each asset, in order to be able to quickly display a small preview and to enable downloading in uniform image sizes.

These standard variants (or _versions_*) were chosen for user convenience. We recommend that you first check whether these variants are sufficient for you.

If your application requires other variants, additional variants can be configured as follows. To make the changes effective, just restart the `easydb-server` container.

* _A version is created in easydb by editing the original application file, e. g. by cropping. A data record can therefore have an original file with several versions. For a clear differentiation, the different file sizes for previews and downloads is called variants here._


## produce settings

Add the following lines to the configuration, e.g. `config/easydb-server.yml`. The storage location of the `config` directory was defined during the [Installation](/en/sysadmin/installation/#mount).

Make sure to not create duplicate lines. If a line already exists, e.g. `include_before:`, then only put the missing line beneath it. Make sure to use correct indentation. If in doubt use a linter tool or ask us for help. Problems of this kind can prevent the easydb from starting. We suggest to keep a backup of your previous configuration.

```yaml
include_before:
  - /config/eas_rights_management.yml

eas:
  produce_settings: /config/eas_produce.json
```

The file given for `produce_settings` defines which variants are created after the upload.

Get the default configuration of variants as a starting point and for editing:

```bash
docker cp easydb-server:/easydb-5/base/eas/rights_management.yml /srv/easydb/config/eas_rights_management.yml
docker cp easydb-server:/easydb-5/base/eas/eas-produce.json      /srv/easydb/config/eas_produce.json
```

Edit `eas_produce.json` and add the variants you desire.

Example: Adding a variant with maximum size of 500 pixels:

```json
[...]
        "image": {
                "__all": {
[...]
                        "500px": {
                                "target_size": "500x500",
                                "target_size_minimum": "251x251",
                                "target_format": "jpg",
                                "target_interlace": "1",
                                "target_quality": "80",
                                "target_no_enlarge": "1"
                        },
```

* Maximum size of 500 is implemented by `"target_size": "500x500",`.
* `500px` is the name of the variant. Names that only contain numbers are NOT VALID. Make sure to also include letters.
* `__all` is an existing paragraph. You may put your new variant into it, as in this example. Then your new variant is produced for assets no matter whether the format of the original file is png, jpg, tiff, etc.. If you put a new variant under `jpg:` instead of `__all` then the new variant will only be created for assets which are of type jpg in their original ( = imported) file.
* Putting your new variant into the `image` clause, as in this example, defines that this variant is only to be produced for assets which are images in their original file. You could instead use the clauses `video`, `office`, etc. or the clause `__all` with the same indentation as `image`, to produce for all classes.
* `"target_size_minimum": "251x251",` defines that this preview is NOT to be generated for assets which are smaller than 251 pixels in both dimensions.
* The preview is generated as a jpg file. E.g. `png` and `tiff` are also possible.
* `target_interlace` and `target_quality` are for jpg only. For `png` and `tif` consider e.g. `"target_alpha": "on"` for transparency or `"target_dpi": "300"` for printing.
* Make sure to include all needed commas and to avoid any superflous commas. A superflous commma would be e.g. one at the end of a list. Note for example that there is no comma after `"target_no_enlarge": "1"` in the example above. Consider using a syntax checker and linter tool for json.

## eas_rights_management.yml

This file contains configuration settings that are relevant for the rights management. The settings always refer to variants of file previews. The files are divided into file classes:

* **image**
* **video**
* **audio**
* **office**
* **archive**
* **vector2d**
* **vector3d**
* **unknown**

For the new variant `500px` (example shown above), you would include in `eas_rights_management.yml`:

```yaml
eas:
  rights_management:
    image:
      versions:
        - version: 500px
          size_print: 500px variant
          size_limit: 500<commit_msg>clarification: multiple variants with the same target_size<commit_after>---
title: "EAS_Produce"
layout: config
menu:
  main:
    name: "EAS-Produce"
    identifier: "sysadmin/konfiguration/easydb-server.yml/produce"
    parent: "sysadmin/konfiguration/easydb-server.yml"
easydb-server.yml:
  - eas.rights_management.image.versions[].<class>.size_print
  - eas.rights_management.image.versions[].<class>.size_limit
  - eas.rights_management.image.versions[].<class>.export
  - eas.rights_management.image.versions[].<class>.rightsmanagement
  - eas.rights_management.image.versions[].<class>.group
  - eas.rights_management.image.versions[].<class>.zoomable
  - eas.rights_management.video.versions[].<class>.version
  - eas.rights_management.video.versions[].<class>.size_print
  - eas.rights_management.video.versions[].<class>.size_limit
  - eas.rights_management.video.versions[].<class>.export
  - eas.rights_management.video.versions[].<class>.group
  - eas.rights_management.video.versions[].<class>.rightsmanagement
  - eas.rights_management.video.versions[].<class>.standard
  - eas-rights_management.audio.versions[].<class>.version
  - eas-rights_management.audio.versions[].<class>.size_print
  - eas-rights_management.audio.versions[].<class>.export
  - eas-rights_management.audio.versions[].<class>.rightsmanagement
  - eas-rights_management.audio.versions[].<class>.group
  - eas-rights_management.audio.versions[].<class>.standard
  - eas-rights_management.office.versions[].<class>.version
  - eas-rights_management.office.versions[].<class>.size_print
  - eas-rights_management.office.versions[].<class>.export
  - eas-rights_management.office.versions[].<class>.rightsmanagement
  - eas-rights_management.office.versions[].<class>.standard
  - eas-rights_management.archive.versions[].<class>.version
  - eas-rights_management.archive.versions[].<class>.size_print
  - eas-rights_management.archive.versions[].<class>.group
  - eas-rights_management.archive.versions[].<class>.rightsmanagement
  - eas-rights_management.archive.versions[].<class>.limit
  - eas-rights_management.archive.versions[].<class>.standard
  - eas-rights_management.unknown.versions[]
  - eas-rights_management.vector2d.versions[]
  - eas-rights_management.vector3d.versions[]
---
# File size for download and preview

For each asset (picture, document, etc.) easydb provides automatically calculated variants of each asset, in order to be able to quickly display a small preview and to enable downloading in uniform image sizes.

These standard variants (or _versions_*) were chosen for user convenience. We recommend that you first check whether these variants are sufficient for you.

If your application requires other variants, additional variants can be configured as follows. To make the changes effective, just restart the `easydb-server` container.

* _A version is created in easydb by editing the original application file, e. g. by cropping. A data record can therefore have an original file with several versions. For a clear differentiation, the different file sizes for previews and downloads is called variants here._


## produce settings

Add the following lines to the configuration, e.g. `config/easydb-server.yml`. The storage location of the `config` directory was defined during the [Installation](/en/sysadmin/installation/#mount).

Make sure to not create duplicate lines. If a line already exists, e.g. `include_before:`, then only put the missing line beneath it. Make sure to use correct indentation. If in doubt use a linter tool or ask us for help. Problems of this kind can prevent the easydb from starting. We suggest to keep a backup of your previous configuration.

```yaml
include_before:
  - /config/eas_rights_management.yml

eas:
  produce_settings: /config/eas_produce.json
```

The file given for `produce_settings` defines which variants are created after the upload.

Get the default configuration of variants as a starting point and for editing:

```bash
docker cp easydb-server:/easydb-5/base/eas/rights_management.yml /srv/easydb/config/eas_rights_management.yml
docker cp easydb-server:/easydb-5/base/eas/eas-produce.json      /srv/easydb/config/eas_produce.json
```

Edit `eas_produce.json` and add the variants you desire.

Example: Adding a variant with maximum size of 500 pixels:

```json
[...]
        "image": {
                "__all": {
[...]
                        "500px": {
                                "target_size": "500x500",
                                "target_size_minimum": "251x251",
                                "target_format": "jpg",
                                "target_interlace": "1",
                                "target_quality": "80",
                                "target_no_enlarge": "1"
                        },
```

* Maximum size of 500 is implemented by `"target_size": "500x500",`.
* `500px` is the name of the variant. Names that only contain numbers are NOT VALID. Make sure to also include letters.
* There may be multiple variants with the same target_size. Just make sure to give them unique names.
* `__all` is an existing paragraph. You may put your new variant into it, as in this example. Then your new variant is produced for assets no matter whether the format of the original file is png, jpg, tiff, etc.. If you put a new variant under `jpg:` instead of `__all` then the new variant will only be created for assets which are of type jpg in their original ( = imported) file.
* Putting your new variant into the `image` clause, as in this example, defines that this variant is only to be produced for assets which are images in their original file. You could instead use the clauses `video`, `office`, etc. or the clause `__all` with the same indentation as `image`, to produce for all classes.
* `"target_size_minimum": "251x251",` defines that this preview is NOT to be generated for assets which are smaller than 251 pixels in both dimensions.
* The preview is generated as a jpg file. E.g. `png` and `tiff` are also possible.
* `target_interlace` and `target_quality` are for jpg only. For `png` and `tif` consider e.g. `"target_alpha": "on"` for transparency or `"target_dpi": "300"` for printing.
* Make sure to include all needed commas and to avoid any superflous commas. A superflous commma would be e.g. one at the end of a list. Note for example that there is no comma after `"target_no_enlarge": "1"` in the example above. Consider using a syntax checker and linter tool for json.

## eas_rights_management.yml

This file contains configuration settings that are relevant for the rights management. The settings always refer to variants of file previews. The files are divided into file classes:

* **image**
* **video**
* **audio**
* **office**
* **archive**
* **vector2d**
* **vector3d**
* **unknown**

For the new variant `500px` (example shown above), you would include in `eas_rights_management.yml`:

```yaml
eas:
  rights_management:
    image:
      versions:
        - version: 500px
          size_print: 500px variant
          size_limit: 500
{'fraction_non_alphanumeric': 0.10369206598586017, 'fraction_numerical': 0.00928372491608941, 'mean_word_length': 3.7681307456588358, 'pattern_counts': {'":': 28, '<': 63, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3434719', 'n_tokens_mistral': 4165, 'n_tokens_neox': 3828, 'n_words': 1342}