diff --git a/automation/process-img.sh b/automation/process-img.sh index 2242d62ac..aa9fb70b2 100644 --- a/automation/process-img.sh +++ b/automation/process-img.sh @@ -44,23 +44,26 @@ if [[ ! "$PATH_TO_IMAGE" =~ \.(png|jpg|jpeg)$ ]]; then exit 1 fi +MODIFICATION_TIME=$(stat -c %Y "$PATH_TO_IMAGE") IMG_DESTINATION="${STATIC_DIRECTORY_NAME}/preview" mkdir -p $IMG_DESTINATION -function check_file_exists() { +function check_file_exists_and_new() { local file=$1 if [ -f "${file}" ] && [ "$ALLOW_OVERWRITE" != "true" ]; then - echo "$file exists. Please remove it or set ALLOW_OVERWRITE=true" - exit 0 + if [ $MODIFICATION_TIME -lt $(stat -c %Y "${file}") ]; then + echo "$file exists and newer than the source image. Please remove it or set ALLOW_OVERWRITE=true" + exit 0 + fi fi } -check_file_exists "${IMG_DESTINATION}/social_preview.jpg" -check_file_exists "${IMG_DESTINATION}/title.jpg" -check_file_exists "${IMG_DESTINATION}/preview.jpg" -check_file_exists "${IMG_DESTINATION}/title.webp" -check_file_exists "${IMG_DESTINATION}/preview.webp" +check_file_exists_and_new "${IMG_DESTINATION}/social_preview.jpg" +check_file_exists_and_new "${IMG_DESTINATION}/title.jpg" +check_file_exists_and_new "${IMG_DESTINATION}/preview.jpg" +check_file_exists_and_new "${IMG_DESTINATION}/title.webp" +check_file_exists_and_new "${IMG_DESTINATION}/preview.webp" convert "${PATH_TO_IMAGE}" -resize "${SOCIAL_PREVIEW_RESOLUTION}^" -gravity center -extent $SOCIAL_PREVIEW_RESOLUTION "${IMG_DESTINATION}/social_preview.jpg"; diff --git a/qdrant-landing/static/blog/vector-search-and-applications-record/preview/preview.jpg b/qdrant-landing/static/blog/vector-search-and-applications-record/preview/preview.jpg index 17826947b..453707fa7 100644 Binary files a/qdrant-landing/static/blog/vector-search-and-applications-record/preview/preview.jpg and b/qdrant-landing/static/blog/vector-search-and-applications-record/preview/preview.jpg differ diff --git a/qdrant-landing/static/blog/vector-search-and-applications-record/preview/preview.webp b/qdrant-landing/static/blog/vector-search-and-applications-record/preview/preview.webp index 7fb09fa23..a5a2b6c9b 100644 Binary files a/qdrant-landing/static/blog/vector-search-and-applications-record/preview/preview.webp and b/qdrant-landing/static/blog/vector-search-and-applications-record/preview/preview.webp differ diff --git a/qdrant-landing/static/blog/vector-search-and-applications-record/preview/social_preview.jpg b/qdrant-landing/static/blog/vector-search-and-applications-record/preview/social_preview.jpg index d12b186ad..813126be3 100644 Binary files a/qdrant-landing/static/blog/vector-search-and-applications-record/preview/social_preview.jpg and b/qdrant-landing/static/blog/vector-search-and-applications-record/preview/social_preview.jpg differ diff --git a/qdrant-landing/static/blog/vector-search-and-applications-record/preview/title.jpg b/qdrant-landing/static/blog/vector-search-and-applications-record/preview/title.jpg index e54eb42dd..fc8ebd69f 100644 Binary files a/qdrant-landing/static/blog/vector-search-and-applications-record/preview/title.jpg and b/qdrant-landing/static/blog/vector-search-and-applications-record/preview/title.jpg differ diff --git a/qdrant-landing/static/blog/vector-search-and-applications-record/preview/title.webp b/qdrant-landing/static/blog/vector-search-and-applications-record/preview/title.webp index c9a2db94f..e658be48f 100644 Binary files a/qdrant-landing/static/blog/vector-search-and-applications-record/preview/title.webp and b/qdrant-landing/static/blog/vector-search-and-applications-record/preview/title.webp differ