-
Notifications
You must be signed in to change notification settings - Fork 0
20260804_#115_Blog_Ingest_API에_이미지_파일_업로드_엔드포인트_추가 : feat : 블로그 ingest API에 이미지/파일 업로드 엔드포인트 추가 https://github.com/Chuseok22/chuseok22-home-server/issues/115 #116
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
Merged
Chuseok22
merged 2 commits into
main
from
20260804_#115_Blog_Ingest_API에_이미지_파일_업로드_엔드포인트_추가
Aug 4, 2026
The head ref may contain hidden characters: "20260804_#115_Blog_Ingest_API\uC5D0_\uC774\uBBF8\uC9C0_\uD30C\uC77C_\uC5C5\uB85C\uB4DC_\uC5D4\uB4DC\uD3EC\uC778\uD2B8_\uCD94\uAC00"
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| from django.urls import path | ||
|
|
||
| from apps.blog.views import BlogCategoryListView, BlogIngestView | ||
| from apps.blog.views import BlogCategoryListView, BlogIngestImageUploadView, BlogIngestView | ||
|
|
||
| urlpatterns = [ | ||
| path('ingest/', BlogIngestView.as_view(), name='blog-ingest'), | ||
| path('ingest/images/', BlogIngestImageUploadView.as_view(), name='blog-ingest-image-upload'), | ||
| path('categories/', BlogCategoryListView.as_view(), name='blog-category-list'), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Chuseok22/chuseok22-home-server
Length of output: 6495
🏁 Script executed:
Repository: Chuseok22/chuseok22-home-server
Length of output: 5950
🌐 Web query:
Pillow Image save can raise exceptions malformed or corrupt image documentation💡 Result:
In Pillow, exceptions related to malformed or corrupt images typically occur because the library uses lazy loading, where metadata is read upon opening but the actual image data is only processed (and validated) when you perform an operation like
load()orsave()[1][2]. Common exceptions and behaviors include: OSError (e.g., "broken data stream", "image file is truncated"): This is the most common error when Pillow encounters malformed or incomplete data during decoding [3][4]. Because of lazy loading, if you do not explicitly callload()or access image data afterImage.open(), such errors may be deferred and only raised later during asave()operation [1]. Handling Truncated Images: If you need to process images that are partially corrupt or truncated, you can setImageFile.LOAD_TRUNCATED_IMAGES = True[3][5]. This allows Pillow to attempt to parse and load as much data as possible instead of raising an error [4]. Integrity Checking: TheImage.verify()method is available to check for file integrity without decoding the entire image [5]. However, be aware that its effectiveness varies by format; for example, it is primarily implemented for PNG files to verify CRC checksums and may not catch all types of corruption in other formats [4]. Encoder and Memory Errors: Duringsave(), you may encounterOSError(e.g., "encoder error -2"),MemoryError, orValueErrordue to internal buffer limitations, unsupported image modes, or invalid data structures (e.g., zero-dimension images, invalid palette sizes) [1][6][7][8]. If you encounter persistent encoder errors during save operations—often with progressive or optimized JPEGs—adjustingImageFile.MAXBLOCKcan sometimes serve as a workaround by increasing the internal buffer size [6][9]. To robustly handle potential issues, it is recommended to wrap image loading and processing operations in a try-except block and explicitly callimg.load()if you need to validate the integrity of the image data immediately upon opening [4][1].Citations:
Image.verifyfails to detect corrupted file python-pillow/Pillow#6342_save_image()의 Pillow 인코딩 실패를 실패 결과로 변환하십시오.image.save(buffer, ...)는 손상/잘린 GIF/WebP 입력 등에서OSError/ValueError를 발생할 수 있습니다. 현재는image.load()만 처리하므로 이 경로가 예외를 전달하면 파일별 컴프리헨션이 실패하고 전체 업로드 응답이 500이 됩니다. 해당 예외를MediaUploadResult(success=False, error_message=...)로 변환하십시오.🤖 Prompt for AI Agents