<p>File Storage in GNU social is used for avatars, for notes containing
attachments, and for notes containing links (in which case is an Embed preview).
Notes can be created by local users or fetched from remote actors. Filehash is
used to reduce file duplication.</p>
<p>When a user shares a Link that uses OpenGraph tags or has an OEmbed provider,
the <ahref="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/Embed">Embed plugin</a> generates a preview for it that may contain a thumbnail.</p>
<p>When a user shares a Link to an image, the <ahref="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/StoreRemoteMedia">StoreRemoteMedia plugin</a> can fetch the
file and make it available as an attachment, and will generate a thumbnail.</p>
<p>When an image, video, or other file type is uploaded or retrieved, an Attachment
entity is created. When a thumbnail is requested, one is generated.</p>
<p>There are three relevant plugins for attachment handling:</p>
<ul>
<li><ahref="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/ImageEncoder">ImageEncoder</a>: Allows to compress, validate, rescale, and sanitize images using VIPS.</li>
<li><ahref="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/VideoEncoder">VideoEncoder</a>: Allows to compress, validate, rescale, and sanitize videos using FFMpeg.</li>
<li><ahref="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/FileQuota">FileQuota</a>: Ensures a user stays under the file quota.</li>
</ul>
<h2>How is the code organised?</h2>
<p>There are various entities related to attachment, and thumbnail handling.