Update app.py
Browse files
app.py
CHANGED
|
@@ -22,15 +22,14 @@ def blob_to_base64_html(blob_data):
|
|
| 22 |
try:
|
| 23 |
if isinstance(blob_data, (bytes, bytearray)):
|
| 24 |
encoded = base64.b64encode(blob_data).decode('utf-8')
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
return str(blob_data)
|
| 35 |
except Exception as e:
|
| 36 |
return str(blob_data)
|
|
@@ -665,29 +664,28 @@ table th:nth-child(6):nth-last-child(1), table td:nth-child(6):nth-last-child(1)
|
|
| 665 |
/* -------------------------- */
|
| 666 |
/* 기본 테이블 & 스크롤 설정 */
|
| 667 |
/* -------------------------- */
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
.dataframe
|
| 676 |
-
max-height: none !important;
|
| 677 |
-
overflow-y: visible !important;
|
| 678 |
-
}
|
| 679 |
-
.dataframe > div {
|
| 680 |
-
max-height: none !important;
|
| 681 |
-
overflow: visible !important;
|
| 682 |
-
}
|
| 683 |
-
td {
|
| 684 |
-
font-size: 18px !important;
|
| 685 |
-
white-space: pre-wrap !important;
|
| 686 |
-
word-break: break-word !important;
|
| 687 |
-
line-height: 1.6;
|
| 688 |
-
padding: 10px;
|
| 689 |
vertical-align: top !important;
|
| 690 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 691 |
|
| 692 |
"""
|
| 693 |
if __name__ == "__main__":
|
|
|
|
| 22 |
try:
|
| 23 |
if isinstance(blob_data, (bytes, bytearray)):
|
| 24 |
encoded = base64.b64encode(blob_data).decode('utf-8')
|
| 25 |
+
# 💡 [핵심] img를 1200px짜리 div로 강제로 감싸서 Gradio가 못 건드리게 합니다.
|
| 26 |
+
# width: 1200px !important 를 사용하여 어떤 상황에서도 크게 만듭니다.
|
| 27 |
+
return f"""
|
| 28 |
+
<div style="width: 1200px !important; margin: 10px 0;">
|
| 29 |
+
<img src='data:image/png;base64,{encoded}'
|
| 30 |
+
style='width: 100% !important; height: auto !important; display: block; border: 1px solid #ddd;' />
|
| 31 |
+
</div>
|
| 32 |
+
"""
|
|
|
|
| 33 |
return str(blob_data)
|
| 34 |
except Exception as e:
|
| 35 |
return str(blob_data)
|
|
|
|
| 664 |
/* -------------------------- */
|
| 665 |
/* 기본 테이블 & 스크롤 설정 */
|
| 666 |
/* -------------------------- */
|
| 667 |
+
.dataframe {
|
| 668 |
+
display: block !important;
|
| 669 |
+
overflow-x: auto !important;
|
| 670 |
+
white-space: nowrap !important;
|
| 671 |
+
}
|
| 672 |
+
|
| 673 |
+
/* 2. 모든 셀 상단 정렬 (이게 적용되어야 번호가 맨 위에 붙습니다) */
|
| 674 |
+
.dataframe td {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 675 |
vertical-align: top !important;
|
| 676 |
+
padding: 15px !important;
|
| 677 |
+
white-space: normal !important; /* 글자는 자동 줄바꿈 허용 */
|
| 678 |
+
}
|
| 679 |
+
|
| 680 |
+
/* 3. 이미지 칸(Description)이 너무 좁아지지 않게 방어 */
|
| 681 |
+
.dataframe td:nth-child(2) {
|
| 682 |
+
min-width: 1250px !important;
|
| 683 |
+
}
|
| 684 |
+
|
| 685 |
+
/* 4. Gradio 기본 이미지 제한 해제 */
|
| 686 |
+
.dataframe img {
|
| 687 |
+
max-width: none !important;
|
| 688 |
+
}
|
| 689 |
|
| 690 |
"""
|
| 691 |
if __name__ == "__main__":
|