Updated Developer documentation (markdown)

This commit is contained in:
Bendegúz Gyönki 2020-11-29 22:18:33 +01:00
parent 6213347ea8
commit 0c48c436d2

View File

@ -83,16 +83,15 @@ This file contains our own MagicMemory library that provides memory allocation f
`main` is the entrypoint of the previewer module. `main` is the entrypoint of the previewer module.
`perform_extraction` takes care of the preview extraction process: it calls parser and validator functions and other helper functions. `perform_extraction` takes care of the preview extraction process: it calls parser and validator functions and other helper functions. In theory, the size of a CAFF file can be really huge. In the case of our previewer, only files smaller than 512 megabytes are processed.
### utils.c ### utils.c
`read_file_to_mem` is used to read CAFF files into memory. `read_file_to_mem` is used to read CAFF files into memory.
### libtarga.c ### libtarga.c
This files contains the [LibTarga](https://research.cs.wisc.edu/graphics/Gallery/LibTarga/) library by Alex Mohr. This file contains the [LibTarga](https://research.cs.wisc.edu/graphics/Gallery/LibTarga/) library by Alex Mohr.
# CAFF previewer wrapper # CAFF previewer wrapper
This module makes communication between the previewer and the web client possible. This module makes communication between the previewer and the web client possible.
@ -107,6 +106,27 @@ The module provides only one endpoint:
**Response:** If the preview extraction is successful, the response contains a single PNG image. The content type is set to `image/png`. **Response:** If the preview extraction is successful, the response contains a single PNG image. The content type is set to `image/png`.
## Integrity checking
CAFF previewer wrapper provides two headers in the response that can be used to check the integrity of transferred files. These are the following:
- `X-request-checksum` contains the md5 checksum of the received file.
- `X-response-checksum` contains the md5 checksum of the converted file.
These checksums can be used to detect errors during file transfer.
## Preview process
This section gives an overview of the preview creation process.
### Converting CAFF to TGA
After the wrapper receives a CAFF file, it uses the CAFF previewer written in C to extract a preview. The output of the previewer is a TGA file.
### Converting TGA to PNG
The wrapper uses ImageMagick to convert the TGA file (output of the previewer) to PNG. This step is done because PNG is a more suitable image format for the web application than TGA.
# Web application # Web application
This module provides the web UI for the users. This module provides the web UI for the users.