-
Notifications
You must be signed in to change notification settings - Fork 4
Add size check of image #95
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
Conversation
| if not utils.is_video_supported_ext(file_path): | ||
| raise FastLabelInvalidException( | ||
| "Supported extensions are mp4.", 422) | ||
| if os.path.getsize(file_path) > const.SUPPORTED_VIDEO_SIZE: |
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.
拡張子と同じように、utilを作成してチェックするようにしました。
| # API can accept under 250 MB ( 250 * 1024 * 1024 ) | ||
| SUPPORTED_VIDEO_SIZE = 262144000 | ||
| # API can accept under 250 MB | ||
| SUPPORTED_VIDEO_SIZE = 250 * math.pow(1024, 2) |
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.
math.pow を使って記述した方がわかりやすいと思ったので、変更しました
eisuke-ueta
left a comment
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.
LGTM
|
@ryoKaz リリース作業しておいてもらえると助かります! |
|
SDKの自動リリース、誰かにGitHubActionsとかで作ってもらっても良さそう。 |
Related issue