- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스) - Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포 - 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
773 B
TypeScript
33 lines
773 B
TypeScript
/* eslint-env browser */
|
|
import { Platform } from 'expo-modules-core';
|
|
|
|
import { getFilename } from './AssetUris';
|
|
|
|
type ImageInfo = {
|
|
name: string;
|
|
width: number;
|
|
height: number;
|
|
};
|
|
|
|
export function isImageType(type: string): boolean {
|
|
return /^(jpeg|jpg|gif|png|bmp|webp|heic)$/i.test(type);
|
|
}
|
|
|
|
export function getImageInfoAsync(url: string): Promise<ImageInfo> {
|
|
if (!Platform.isDOMAvailable) {
|
|
return Promise.resolve({ name: getFilename(url), width: 0, height: 0 });
|
|
}
|
|
return new Promise((resolve, reject) => {
|
|
const img = new Image();
|
|
img.onerror = reject;
|
|
img.onload = () => {
|
|
resolve({
|
|
name: getFilename(url),
|
|
width: img.naturalWidth,
|
|
height: img.naturalHeight,
|
|
});
|
|
};
|
|
img.src = url;
|
|
});
|
|
}
|