Skip to content

Conversation

@ijufumi
Copy link
Contributor

@ijufumi ijufumi commented Dec 14, 2021

@ijufumi ijufumi self-assigned this Dec 14, 2021
@ijufumi ijufumi changed the title [WIP] Add size check of image Add size check of image Dec 18, 2021
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:
Copy link
Contributor Author

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)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

math.pow を使って記述した方がわかりやすいと思ったので、変更しました

Copy link
Contributor

@eisuke-ueta eisuke-ueta left a comment

Choose a reason for hiding this comment

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

LGTM

@eisuke-ueta eisuke-ueta merged commit 0566a49 into develop Dec 18, 2021
@eisuke-ueta eisuke-ueta deleted the feature/1116-image-size-check branch December 18, 2021 06:23
@eisuke-ueta
Copy link
Contributor

@ryoKaz リリース作業しておいてもらえると助かります!

@eisuke-ueta
Copy link
Contributor

SDKの自動リリース、誰かにGitHubActionsとかで作ってもらっても良さそう。

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.

3 participants