Commit Graph

21 Commits

Author SHA1 Message Date
Diogo Peralta Cordeiro 30975111d9
[ImageEncoder] Make plugin respect instance config and use the new core interface 2021-08-18 23:38:03 +01:00
Hugo Sales 7320c6834f
[UI][Attachment] Use Attachment methods to get the proper URL, rather than crafting it in a template 2021-08-18 17:35:09 +01:00
Hugo Sales 9c533a54a7
[ATTACHMENTS] Ensure thumbnail dimensions are bounded and change way cropping is implemented 2021-08-18 17:35:09 +01:00
Diogo Peralta Cordeiro 3af33d1317
[ImageEncoder] Fix ImageSanitization, it should never modify the input image 2021-08-17 23:35:35 +01:00
Diogo Peralta Cordeiro 31c5fd6da7
[ImageEncoder] Handle VIPS unsupported image type 2021-08-14 17:04:58 +01:00
Diogo Peralta Cordeiro 9781ddc8e0
[AttachmentToNote][Attachment] Add title getter to Attachment 2021-08-14 17:00:52 +01:00
Diogo Peralta Cordeiro 32ad5dbd74
[ENTITY] Split Attachment in various new entities
Remove Attachment Scope
Fixed some minor bugs

Scope will be implemented later in v3. It doesn't make sense to have
the scope handling being per attachment. Different actors can post
the same attachment with different scopes. The attachment controller
will assume the highest level of scope applied to the attachment and
the rest will be handled at the note level.

Motivation:
* Remove title from attachment, as it's part of the relation between attachment and note.
* Remove actor from attachment, many actors may publish the same attachment.
* Remove is_local from attachment,  as it's part of the relation between attachment and note.
* Remove remote_url from attachment, different urls can return the same attachment.

Addition:
* Attachment now has a lives attribute,  it's a reference counter with a nicer name
* GSActorToAttachment
* GSActorToRemoteURL
* RemoteURL
* RemoteURLToNote
* RemoteURLToAttachment
* AttachmentToNote now has a title attribute
2021-08-14 17:00:46 +01:00
Hugo Sales 9077403f65
[ImageEncoder] Don't print_r the exception as that leads to an OOM error 2021-08-03 19:23:03 +00:00
Diogo Peralta Cordeiro cc0ef73799 [MEDIA][AttachmentThumbnail] Add mimetype to Entity 2021-07-22 21:17:23 +01:00
Diogo Peralta Cordeiro c3eda07521 [Media] EncoderPlugins should handle the views that concern them
Ensure the intended filetypes and mimetypes during Vips conversions (part 2)
Sanitize Attachments instead of Validate (part 2)
Various bug fixes
2021-07-22 21:10:45 +01:00
Diogo Peralta Cordeiro 4d2131808a [FILE][TemporaryFile] Fix various issues now that we also have Symfony's file abstractions 2021-07-20 23:46:18 +01:00
Hugo Sales b99fab00e9 [UTILS][TemporaryFile] Change way TemporaryFile takes arguments and it's internal implementation 2021-05-02 15:48:33 +00:00
Diogo Peralta Cordeiro c58d7e470a [CORE][ImageEncoder] Add width and height back in attachment entity and allow for differently sized thumbs
The strategy adopted involves predicting the thumb size as we did in v2 before having vips resize
2021-05-02 00:00:02 +01:00
Hugo Sales 1bf5e9d117 [ImageEncoder][FileQuota] Move quota enforcement to it's own plugin, so it can be easily shared and disabled 2021-04-30 23:08:08 +01:00
Hugo Sales 365a7b436f [ImageEncoder] Implement attachment validation for images. This limits the maximum dimensions of the file, enforces a per file, per user and per user-month size quota and fixes the title if it's a filename, by replacing the extension to the new one 2021-04-30 23:08:08 +01:00
Hugo Sales e699824b1d [Embed] Fix plugin. Only attempt to show an image, if we have one 2021-04-28 15:03:17 +00:00
Hugo Sales 82d9326343 [PLUGINS] Remove scripts. These will need to be implemented with Commands 2021-04-27 18:10:18 +00:00
Diogo Peralta Cordeiro 9814baf192 [UI] Use thumbnail path for thumbs 2021-04-19 13:22:50 +01:00
Hugo Sales 5ec7717fa1 [ATTACHMENTS] Move thumbnail controller to core and cleanup 2021-04-19 13:22:50 +01:00
Hugo Sales d316f9dd6f [ImageEncoder] Change preferred type to always be WEBP 2021-04-19 13:22:50 +01:00
Diogo Peralta Cordeiro 2f137f8b44 [ATTACHMENTS] Even more further refactoring
Introduce Encoder plugins Instead of abstract upload and thumb modules

Ported attachment routes. In v3 thumbnail depends on existing attachment
so route updated accordingly.
2021-04-19 13:22:04 +01:00