iamge path
This commit is contained in:
@@ -544,10 +544,9 @@ def process_image_generation_queue(self, image_ids: list, account_id: int = None
|
|||||||
|
|
||||||
# Try frontend/public/images/ai-images/ first (web-accessible)
|
# Try frontend/public/images/ai-images/ first (web-accessible)
|
||||||
try:
|
try:
|
||||||
from django.conf import settings
|
# Use absolute path: /data/app/igny8/frontend/public/images/ai-images/
|
||||||
base_dir = Path(settings.BASE_DIR) if hasattr(settings, 'BASE_DIR') else Path(__file__).resolve().parent.parent.parent
|
# This matches the structure where frontend is at project root level
|
||||||
# Navigate to frontend/public/images/ai-images/
|
images_dir = '/data/app/igny8/frontend/public/images/ai-images'
|
||||||
images_dir = str(base_dir / 'frontend' / 'public' / 'images' / 'ai-images')
|
|
||||||
os.makedirs(images_dir, exist_ok=True)
|
os.makedirs(images_dir, exist_ok=True)
|
||||||
# Test write access
|
# Test write access
|
||||||
test_file = os.path.join(images_dir, '.write_test')
|
test_file = os.path.join(images_dir, '.write_test')
|
||||||
|
|||||||
@@ -402,19 +402,11 @@ class ImagesViewSet(SiteSectorModelViewSet):
|
|||||||
# Try alternative locations based on the filename
|
# Try alternative locations based on the filename
|
||||||
filename = os.path.basename(file_path)
|
filename = os.path.basename(file_path)
|
||||||
alternative_paths = [
|
alternative_paths = [
|
||||||
'/data/app/igny8/images/' + filename, # Primary location
|
'/data/app/igny8/frontend/public/images/ai-images/' + filename, # Primary location (web-accessible)
|
||||||
|
'/data/app/igny8/images/' + filename, # Secondary location
|
||||||
'/data/app/images/' + filename, # Fallback location
|
'/data/app/images/' + filename, # Fallback location
|
||||||
]
|
]
|
||||||
|
|
||||||
# Also try project-relative path
|
|
||||||
try:
|
|
||||||
from django.conf import settings
|
|
||||||
from pathlib import Path
|
|
||||||
base_dir = Path(settings.BASE_DIR) if hasattr(settings, 'BASE_DIR') else Path(__file__).resolve().parent.parent.parent
|
|
||||||
alternative_paths.append(str(base_dir / 'data' / 'app' / 'images' / filename))
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Try each alternative path
|
# Try each alternative path
|
||||||
found = False
|
found = False
|
||||||
for alt_path in alternative_paths:
|
for alt_path in alternative_paths:
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ export default function ContentImageCell({ image, maxPromptLength = 100 }: Conte
|
|||||||
|
|
||||||
{image.status === 'generated' && (
|
{image.status === 'generated' && (
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
{/* Show local image if available, otherwise show original URL */}
|
{/* Always show image from image_path if available, otherwise from image_url */}
|
||||||
{image.image_path ? (
|
{image.image_path && image.image_path.trim() ? (
|
||||||
<>
|
<>
|
||||||
<img
|
<img
|
||||||
src={getLocalImageUrl(image.image_path)}
|
src={getLocalImageUrl(image.image_path)}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 MiB |
Reference in New Issue
Block a user