Skip to content

Commit

Permalink
Merge pull request #190 from recogito/develop
Browse files Browse the repository at this point in the history
Develop to main
  • Loading branch information
lwjameson authored Jun 3, 2024
2 parents e163f71 + b2b6652 commit 1811ae5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "astro dev",
"build": "astro build",
"build-node": "astro build --config astro.config.node.mjs",
"preview-node": "node ./dist/server/entry.mjs",
"preview-node": "node --max-old-space-size=4096 ./dist/server/entry.mjs",
"install-plugin": "node ./plugins/install-plugin.js",
"astro": "astro",
"preinstall": "node ./plugins/build-registry",
Expand Down
10 changes: 10 additions & 0 deletions src/components/DocumentCard/DocumentCardThumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { ContentTypeIcon } from '@components/DocumentCard/ContentTypeIcon';
import './DocumentCardThumbnail.css';
import { Spinner } from '@components/Spinner';

const CANTALOUPE_PATH: string | undefined = import.meta.env
.PUBLIC_IIIF_CANTALOUPE_PATH;

export interface DocumentCardThumbnailProps {
document: Document;
}
Expand Down Expand Up @@ -66,6 +69,13 @@ export const DocumentCardThumbnail = (props: DocumentCardThumbnailProps) => {
)}
</div>
);
} else if (document.content_type?.startsWith('image/')) {
const url = `${CANTALOUPE_PATH}/${document.id}/square/max/0/default.jpg`;
return (
<div className='document-card-image-container'>
<img src={url} height={200} width={200} />
</div>
);
} else if (document.meta_data?.protocol === 'IIIF_IMAGE') {
const url = document.meta_data.url.replace(
'/info.json',
Expand Down
6 changes: 4 additions & 2 deletions src/pages/[lang]/annotate/[context]/[document]/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ if (document.data.content_type === 'text/plain') {
} else if (document.data.content_type === 'application/pdf') {
viewer = 'PDF';
} else if (
document.data.content_type?.startsWith('image/') ||
document.data.meta_data?.protocol === 'IIIF_IMAGE' ||
document.data.meta_data?.protocol === 'IIIF_PRESENTATION'
) {
Expand Down Expand Up @@ -140,7 +141,8 @@ if (profile.error || !profile.data) {
</BaseLayout>

<style>
html, body {
height: 100%
html,
body {
height: 100%;
}
</style>

0 comments on commit 1811ae5

Please sign in to comment.