Skip to content
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

Merged
merged 3 commits into from
May 31, 2023
Merged

Rework scaled dimensions and compression #737

merged 3 commits into from
May 31, 2023

Conversation

renahlee
Copy link
Contributor

@renahlee renahlee commented May 18, 2023

Overview

This PR:

  • Forces mobile and web through a consolidated compression flow
  • Updates invocations of this.compressed to this.cropped to reflect the aforementioned change
  • Removes unused functions and files (scaleDownDimensions was causing stretching and compressAndResizeImageForPost 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.

@renahlee renahlee requested review from pfrazee and ansh May 18, 2023 20:48
@@ -13,7 +13,7 @@ async function getFile() {
.join('/'),
)
const file = files[_imageCounter++ % files.length]
return await compressAndResizeImageForPost({
return await compressIfNeeded({
Copy link
Contributor Author

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.

Copy link
Collaborator

@pfrazee pfrazee left a 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

@pfrazee pfrazee merged commit 072682d into main May 31, 2023
@pfrazee pfrazee deleted the ollie/APP-636 branch May 31, 2023 00:23
alimony added a commit to alimony/social-app that referenced this pull request May 31, 2023
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants