thumbnailUrl method
Return thumbnail image url of an upload file/image.
The src
is the URL of the image or file.idx.
The code
is the code of the file.code, It can display a photo by the first image of the code.
주의할 점은 code
를 사용하는 경우, 이미지 캐시를 하면, 새로 업로드를 해도, 캐시된 이미지가 변경되지 않을 수 있다. 이와 같은 경우, src
에 파일 번호를 사용하는 것이 좋다.
Implementation
String thumbnailUrl({
String? src,
String? code,
int width = 320,
int height = 320,
int quality = 75,
bool original = false,
}) {
String url = apiUrl.replaceAll('index.php', '');
url += 'etc/phpThumb/phpThumb.php?q=$quality&w=$width&h=$height&f=jpeg';
if (original) url += '&original=Y';
if (src != null && src != '') url += "&src=$src";
if (code != null && code != '') url += "&code=$code";
return url;
}