diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..42051dbd --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# AI Generated Images - Do not commit generated images +frontend/public/images/ai-images/ +**/ai-images/ + +# Also ignore in dist/build output +frontend/dist/images/ai-images/ + diff --git a/frontend/src/components/common/ContentImageCell.tsx b/frontend/src/components/common/ContentImageCell.tsx index 68a8655d..07e55967 100644 --- a/frontend/src/components/common/ContentImageCell.tsx +++ b/frontend/src/components/common/ContentImageCell.tsx @@ -25,6 +25,16 @@ interface ContentImageCellProps { export default function ContentImageCell({ image, maxPromptLength = 100 }: ContentImageCellProps) { const [showFullPrompt, setShowFullPrompt] = useState(false); + // Check if image_path is a valid local file path (not a URL) + const isValidLocalPath = (imagePath: string): boolean => { + // Reject URLs (http:// or https://) + if (imagePath.startsWith('http://') || imagePath.startsWith('https://')) { + return false; + } + // Must contain 'ai-images' to be a valid local path + return imagePath.includes('ai-images'); + }; + // Convert local file path to web-accessible URL const getLocalImageUrl = (imagePath: string): string => { // If path contains 'ai-images', convert to web URL @@ -97,15 +107,15 @@ export default function ContentImageCell({ image, maxPromptLength = 100 }: Conte {image.status === 'generated' && (
No image available
+No image available