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

add max video size and max image size #355

Merged
merged 1 commit into from
Mar 3, 2025
Merged

Conversation

josephshenq
Copy link
Contributor

PR Title

Issue Number(s): #345 .

What does this PR change and why?

If an uploaded video has size larger than max video size (50MB), it would return error message about that. If an uploaded image has size larger than max image size (3MB), it would automatically resize the image and reduce its size.

Critical Changes

  • add logic in onDrop for checking file size, and resizeImage helps to resize image with max width/height.

Testing

  1. For video, I tried uploading video greater than 50MB, and it will give me desired error message.
  2. For image, I tried uploading 4.2MB image (8192*4951), and the resize function would resize it to 4096 * 2475.5

Copy link

github-actions bot commented Mar 2, 2025

Coverage report for web

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 19.12% 265/1386
🔴 Branches 11.43% 48/420
🔴 Functions 7.79% 31/398
🔴 Lines 12.54% 148/1180

Test suite run failed

Failed tests: 0/23. Failed suites: 8/11.
  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Returning a Promise from "describe" is not supported. Tests must be defined synchronously.

      17 |  * @group unit
      18 |  */
    > 19 | describe("[API] Account - Integration Test", async () => {
         | ^
      20 |   const context = await createContextInner();
      21 |   const caller = appRouter.createCaller(context);
      22 |

      at Object.describe (__tests__/pages/api/account/account.int.test.ts:19:1)

Report generated by 🧪jest coverage report action from 4372e13

Copy link
Member

@SamratSahoo SamratSahoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!!

@SamratSahoo SamratSahoo merged commit 838f4f1 into staging Mar 3, 2025
3 of 4 checks passed
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