deer social fork for personal usage. but you might see a use idk. github mirror
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

better handling of low res images with the fullsize png thing

ayla bebe5931 fb1a2ac5

+18 -13
+18 -13
src/components/Post/Embed/ImageEmbed.tsx
··· 47 47 const items = images.map((img, index) => { 48 48 const recordImage = recordImages[index] ?? [] 49 49 50 + const lowRes = 51 + img.aspectRatio && 52 + img.aspectRatio.width <= 1000 && 53 + img.aspectRatio.height <= 1000 54 + 50 55 const pngSized = 51 56 (loadAsPngs 52 - ? recordImage.size 53 - ? recordImage.quality === 100 && 54 - recordImage.size <= PNG_IMG_MAX_BYTE 55 - : img.aspectRatio && 57 + ? (recordImage.size && 58 + recordImage.quality === 100 && 59 + recordImage.size <= PNG_IMG_MAX_BYTE) || 60 + (img.aspectRatio && 56 61 img.aspectRatio.width <= PNG_IMG_MAX_SIZE && 57 - img.aspectRatio.height <= PNG_IMG_MAX_SIZE 62 + img.aspectRatio.height <= PNG_IMG_MAX_SIZE) 58 63 : false) || false 59 64 60 - const fullsizeUri = modifyImageFormat( 65 + // i'm aware of how ridiculous this looks 66 + // but i think this is the easiest way of doing this 67 + // and it doesn't look thaaaat bad but yeah 68 + img.fullsize = modifyImageFormat( 61 69 img.fullsize, 62 70 pngSized || 63 71 (loadAsPngs && ··· 67 75 : fullsizeFormat, 68 76 ) 69 77 70 - // i'm aware of how ridiculous this looks 71 - // but i think this is the easiest way of doing this 72 - // and it doesn't look thaaaat bad but yeah 73 - img.fullsize = fullsizeUri 74 - img.thumb = pngSized 75 - ? fullsizeUri 76 - : modifyImageFormat(img.thumb, thumbnailFormat) 78 + img.thumb = 79 + pngSized && lowRes 80 + ? img.fullsize 81 + : modifyImageFormat(img.thumb, thumbnailFormat) 77 82 78 83 return { 79 84 uri: img.fullsize,