Initial commit

This commit is contained in:
Alejandro Martinez
2026-02-12 02:04:10 +01:00
commit f09af719cf
13433 changed files with 2193445 additions and 0 deletions

30
node_modules/astro/dist/assets/utils/metadata.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import { AstroError, AstroErrorData } from "../../core/errors/index.js";
import { lookup as probe } from "../utils/vendor/image-size/lookup.js";
async function imageMetadata(data, src) {
let result;
try {
result = probe(data);
} catch {
throw new AstroError({
...AstroErrorData.NoImageMetadata,
message: AstroErrorData.NoImageMetadata.message(src)
});
}
if (!result.height || !result.width || !result.type) {
throw new AstroError({
...AstroErrorData.NoImageMetadata,
message: AstroErrorData.NoImageMetadata.message(src)
});
}
const { width, height, type, orientation } = result;
const isPortrait = (orientation || 0) >= 5;
return {
width: isPortrait ? height : width,
height: isPortrait ? width : height,
format: type,
orientation
};
}
export {
imageMetadata
};