-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework scaled dimensions and compression #737
Conversation
@@ -13,7 +13,7 @@ async function getFile() { | |||
.join('/'), | |||
) | |||
const file = files[_imageCounter++ % files.length] | |||
return await compressAndResizeImageForPost({ | |||
return await compressIfNeeded({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pfrazee I realize this may not be in line with the original intent but looking at the function, it seems sufficient since we just want any file to use with tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally got to this! Looks good from review and testing
* main: (31 commits) fix: make DesktopLeftNav not overflow screen (bluesky-social#762) Fix deeplink when app is suspended (bluesky-social#812) Tune sizing of appearance control Remove lodash.clonedeep in package.json (bluesky-social#652) perf: enable lazy loading for tab navigation (bluesky-social#711) Make terms and notices dates less ambiguous. (bluesky-social#713) Use proxy for fetching link meta (bluesky-social#716) feat(Login): allow submitting on password field (bluesky-social#720) show package.json version on web (bluesky-social#717) Add ability to reply, repost (without quote post), and like posts using VoiceOver (bluesky-social#765) Move MAX_GRAPHEME_LENGTH to constants.ts (bluesky-social#735) fix: content trimmed in server input modal (bluesky-social#733) [typo] correct typo was 'fo' instead of 'to' (bluesky-social#721) Rework scaled dimensions and compression (bluesky-social#737) Use non-pipe translation link (bluesky-social#740) add instructions to removing sentry in build.md (bluesky-social#749) Update HomeIconSolid: widen the front door (bluesky-social#756) Support arrow key navigation for Lightbox.web.tsx (bluesky-social#761) Fix profile load issue + enhancement of profile isCurrent style (bluesky-social#764) Update ProfileHeader.tsx (bluesky-social#810) ...
Overview
This PR:
this.compressed
tothis.cropped
to reflect the aforementioned changescaleDownDimensions
was causing stretching andcompressAndResizeImageForPost
was scaling up low resolution images and hampering upload)Note: compression now occurs before upload rather than compressing during and after cropping. The major downside to this is not being able to get sync validation if, for example, adding a noisy image with high variance that isn't able to meet the file size limit even after compression.