2011-06-14 4 views
0

Galleria에서 동적 이미지 세트를 표시하려고합니다. 동적으로 말하면 이미지가 PHP 스크립트에 의해 런타임에 생성된다는 의미입니다. 문제의 PHP 스크립트는 실제로 두 개의 이미지 (하나의 사진과 이미지를 보호하기 위해 워터 마크로 사용하려는 다른 이미지)를 병합하여 병합합니다.Galleria Dynamic Images 문제

그래서, 갤러리아 사업부 내에서 내 이미지 링크는이에서 이동이에 잘 작동

<a href="images/upload/1024_<?php echo $row_rstImages['image_filename']; ?>"> <img title="<?php echo $row_rstImages['image_title']; ?>" 
alt="<?php echo $row_rstImages['image_description']; ?>" 
src="images/upload/100_<?php echo $row_rstImages['image_filename']; ?>"> </a> 

:

<a href="inc_create_image_wm_gallery.php?s=1024&i=<?php echo $row_rstImages['image_id']; ?>"> <img title="<?php echo $row_rstImages['image_title']; ?>" 
alt="<?php echo $row_rstImages['image_description']; ?>" 
src="images/upload/100_<?php echo $row_rstImages['image_filename']; ?>"> </a> 

을 당신은 아마, 스크립트 'inc_create_image_wm_gallery을 결정한다. php '는 데이터베이스 (i)의 관련 엔트리에서 이미지 크기와 출력 크기의 두 가지 매개 변수를 취합니다.

위의 두 번째 버전의 결과는 Galleria가 원하는 1024 픽셀 버전이 아닌 썸네일 버전 (100 픽셀 너비 버전)을 대신 표시한다는 것입니다.

PHP 스크립트는 적절한 헤더 세트 (header ('content-type : image/jpeg');)를 가지고 있으며 URL에 적절한 매개 변수가있는 브라우저에서 스크립트를 단독으로 사용하면 워터 마크 이미지를 정확하게 출력합니다. 나는 기대할 것이다.

Galleria에 좋지 않은 영향을 줄 수있는 이유는 무엇입니까?

+0

galleria (특히 div)의 html 출력을 확인 했습니까? 변경 사항을 반영하여 진화 했습니까? – greg0ire

답변

1

Galleria가 href의 파일 끝을 감지하기 때문입니다. Galleria가 href를 이미지 파일 (.php 접미어 포함)로 받아들이려면 다음을 시도하십시오.

$('#galleria').galleria({ 
    dataConfig: function(img) { 
     return { 
      image: $(img).parent().attr('href') 
     } 
    } 
});