Skip to content

Commit 117b412

Browse files
committed
Merge stable into release
2 parents fbfb80d + 1f33c07 commit 117b412

File tree

6 files changed

+23
-3
lines changed

6 files changed

+23
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.24.0] - Not released
9+
810
## [2.23.8] - 2025-02-17
911
### Fixed
1012
- Fix the case when the uploaded video original is for some reason missing at

app/controllers/api/v1/AttachmentsController.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,16 @@ export default class AttachmentsController {
241241
response.width = prv.w;
242242
response.height = prv.h;
243243

244-
// With imgproxy, we can resize images (except SVG) and change their format
245-
if (useImgProxy && type === 'image' && attachment.fileExtension !== 'svg') {
244+
// With imgproxy, we can resize images (except some types) and change
245+
// their format
246+
if (
247+
useImgProxy &&
248+
type === 'image' &&
249+
// We don't need to resize SVGs
250+
attachment.fileExtension !== 'svg' &&
251+
// We should not resize (probably) animated legacy GIFs
252+
!(attachment.fileExtension === 'gif' && attachment.isLegacyImage)
253+
) {
246254
let { format } = query;
247255

248256
if (!format) {

app/models.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export class Attachment {
210210
updatedAt: Date;
211211
userId: UUID;
212212
postId: UUID | null;
213+
isLegacyImage: boolean;
213214

214215
constructor(params: AttachmentParams);
215216
static create(

app/models/attachment.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ export function addModel(dbAdapter) {
5858

5959
this.createdAt = params.createdAt;
6060
this.updatedAt = params.updatedAt;
61+
62+
/**
63+
* This image attachment was created before the 'previews' field was
64+
* introduced (i.e. before the v4 API).
65+
*/
66+
this.isLegacyImage = this.mediaType === 'image' && this._previews === null;
6167
}
6268

6369
get previews() {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "freefeed-server",
44
"description": "FreeFeed is an open source FriendFeed clone (yes, it is free and open!) based on Pepyatka open-source FriendFeed clone (yes, that one is also free and open). Basically, this is a social real-time feed aggregator that allows you to share cute kittens, coordinate upcoming events, discuss any other cool stuff on the Internet or setup a private Pepyatka instance in your company.",
55
"homepage": "https://freefeed.net",
6-
"version": "2.23.11",
6+
"version": "2.24.0",
77
"private": true,
88
"scripts": {
99
"start": "cross-env TZ=UTC yarn babel index.js",

test/integration/models/attachment.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ describe('Attachments', () => {
319319
previews: expect.it('to equal', { image: { '': { h: 150, w: 150, ext: 'png' } } }),
320320
width: 150,
321321
height: 150,
322+
isLegacyImage: true,
322323
});
323324
});
324325

@@ -343,6 +344,7 @@ describe('Attachments', () => {
343344
}),
344345
width: 900,
345346
height: 300,
347+
isLegacyImage: true,
346348
});
347349
});
348350

@@ -369,6 +371,7 @@ describe('Attachments', () => {
369371
}),
370372
width: 1500,
371373
height: 1000,
374+
isLegacyImage: true,
372375
});
373376
});
374377

0 commit comments

Comments
 (0)