gnusocial.rocks/v3/milestone-port-media-handling-from-v2.html

152 lines
4.4 KiB
HTML
Raw Normal View History

2021-08-16 19:22:59 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
2021-09-11 18:24:40 +01:00
<meta name="viewport" content="width=device-width, initial-scale=0.86, maximum-scale=5.0, minimum-scale=0.86">
2022-02-25 21:22:57 +00:00
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../assets/css/reset.css">
<link rel="stylesheet" href="../assets/css/blog.css">
<link rel="stylesheet" href="../assets/fonts/opensans/opensans.css">
<title>Milestone: Port Media handling from v2 - GNU social V3</title>
2021-08-16 19:22:59 +01:00
</head><body>
<header>
<div class="home-menu menu menu-horizontal menu-fixed">
2022-02-25 21:22:57 +00:00
<div class="home-menu menu menu-horizontal menu-fixed">
<a class="header-main" href="/"><img src="../assets/img/gnu-social-logo-invert.svg" alt="GNU social"><b>gnu</b>social</a>
<ul class="menu-list">
<li class="menu-item menu-selected"><a href="index.html" class="menu-link">Blog Index</a></li>
<li class="menu-item"><a href="https://code.gnusocial.rocks/" class="menu-link">Repository</a></li>
<li class="menu-item"><a href="https://coverage.gnusocial.rocks/" class="menu-link">Code Coverage</a></li>
<li class="menu-item"><a href="https://docs.gnusocial.rocks/" class="menu-link">Documentation</a></li>
<li class="menu-item"><a href="https://agile.gnusocial.rocks/" class="menu-link">Wiki</a></li>
<li class="menu-item"><a href="https://kanban.undefinedhackers.net/?controller=BoardViewController&action=readonly&token=d2293e55cabae7cceff9fb496c651328195357d392b9e61a9f229ed6d463" class="menu-link">Roadmap</a></li>
</ul>
</div>
</header>
<div class="content-wrapper">
<div class="content">
2021-08-16 19:22:59 +01:00
</div></div></div>
<div id="template-wrapper"><div class="template-unit">
2021-08-16 19:22:59 +01:00
<!-- entry begin -->
<h3><a class="ablack" href="milestone-port-media-handling-from-v2.html">
Milestone: Port Media handling from v2
</a></h3>
<!-- bashblog_timestamp: #202105031337.42# -->
<div class="subtitle">May 03, 2021 &mdash;
GNU social development team
</div>
<!-- text begin -->
2021-08-19 03:10:43 +01:00
<p><strong><a href="https://agile.gnusocial.rocks/doku.php?id=milestones:attachment_media_embed_handling">>WIKI Milestone entry</a></strong></p>
2021-08-16 19:22:59 +01:00
<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 <a href="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 <a href="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
2021-08-19 03:10:43 +01:00
entity is created. When a thumbnail is requested, one is generated if an
EncoderPlugin that supports the mime type is available.</p>
2021-08-16 19:22:59 +01:00
2021-08-19 03:10:43 +01:00
<p>There are two EncoderPlugins implemented:</p>
2021-08-16 19:22:59 +01:00
<ul>
<li><a href="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>
2021-08-19 03:10:43 +01:00
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/VideoEncoder">VideoEncoder</a>: Allows to rescale gifs using FFMpeg.</li>
2021-08-16 19:22:59 +01:00
</ul>
2021-08-19 03:10:43 +01:00
<p>Another helpful plugin is <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/FileQuota">FileQuota</a> which ensures a user stays under the file quota.</p>
2021-08-16 19:22:59 +01:00
<h2>How is the code organised?</h2>
2021-08-19 03:10:43 +01:00
<p>There are various entities related to attachment and thumbnail handling.
The key ones are:</p>
2021-08-16 19:22:59 +01:00
<ul>
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/src/Entity/Attachment.php">Attachment</a></li>
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/src/Entity/AttachmentThumbnail.php">AttachmentThumbnail</a></li>
</ul>
<p>The plugins are able to act by means of the Events system, as elaborated in the
2021-08-19 03:10:43 +01:00
<a href="https://docs.gnusocial.rocks/developer/storage.html">documentation</a>.</p>
2021-08-19 03:15:11 +01:00
2021-08-19 03:20:52 +01:00
2021-08-19 03:33:16 +01:00
2021-09-11 18:24:40 +01:00
2021-12-09 14:52:52 +00:00
2021-12-09 16:47:22 +00:00
2022-01-18 00:25:29 +00:00
2022-01-18 01:24:35 +00:00
2022-01-18 01:39:46 +00:00
2022-01-18 01:58:44 +00:00
2022-02-25 21:22:57 +00:00
2022-01-18 02:11:01 +00:00
2022-01-18 11:41:14 +00:00
2022-01-18 11:42:04 +00:00
2022-01-18 02:48:24 +00:00
2022-01-18 13:14:26 +00:00
2022-03-27 18:02:29 +01:00
2022-01-18 15:54:02 +00:00
2022-03-28 17:42:56 +01:00
2022-03-28 18:00:58 +01:00
2021-08-16 19:22:59 +01:00
<!-- text end -->
<!-- entry end -->
</div>
</div></div>
2022-02-25 21:22:57 +00:00
<footer>
This site's source is <a href="https://code.undefinedhackers.net/GNUsocial/gnusocial.rocks">hosted here</a>.
</footer>
</body></html>