Download the PHP package webdna/imageshop without Composer

On this page you can find all versions of the php package webdna/imageshop. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package imageshop

Official Imageshop plugin for Craft CMS

Supports Craft CMS 4 and Craft CMS 5.

This official plugin integrates Imageshop Digital Asset Management system with Craft CMS by exposing their image selector as a popup that saves the selected image data in a field so the selection can be used in twig templates.

Installation

To install the plugin, follow these instructions.

`

OR do it via the command line

Upgrading to 2.6.0

No migrations are required. After updating, you'll see a new Site language mappings section on the plugin's settings page — all inputs start empty, so existing installs retain the previous auto-derived language behavior unchanged. See Per-site language mapping for how to opt in.

Upgrading from webdna/imageshop-dam

This repository now uses imageshop/imageshop-dam as the Composer package name and Imageshop\Imageshop\... as the PHP namespace.

In your Craft project (not in this plugin repository), run:

  1. Update Composer dependencies.

  2. Update field type references in project config (or DB equivalent):

to:

  1. Apply project config and pending updates.

Notes:

Upgrading to 2.5.0

After updating the plugin via Composer, run migrations to upgrade field content columns from TEXT to MEDIUMTEXT:

Or, if all pending migrations should be applied at once:

Craft 5 support

Version 2.5.0 supports both Craft CMS 4 and Craft CMS 5. No additional configuration is needed — the plugin detects the Craft version at runtime.

Restored "Edit description before insert?"

The showDescription field setting has been restored. When enabled, the Imageshop popup shows a description input field that editors can fill in before inserting the image. The entered description is passed through to the Craft entry's description field.

To enable: edit the Imageshop field in Settings → Fields, and toggle "Edit description before insert?" on.

Removed field settings

The "Show Credits?" (showCredits) field setting remains removed. If your project config YAML files still contain showCredits keys under an Imageshop field's settings, they will be silently ignored.

Imageshop DAM field

To retrieve images from the Imageshop service, you must first create an Imageshop DAM field and assign it to an entry or any another element. The field can hold multiple images and images can be reordered within the field by dragging the grab‑icon that appears in the top‑left corner of each image.

In addition to the image itself, metadata such as the image title and alt text are pulled from the service. This texts exists in several languages, and the plugin displays the appropriate version based on the site’s current language. If current site language content was not present in data pulled from service, default language content will be used. Important: Because of technical constraints, the Imageshop field must now be set to translatable.

You can override the image description and alt text by clicking the cog icon that appears in the top‑left corner when you hover over an image in the control panel. Doing so reveals the override input fields. This works for all languages, and you can also provide descriptions and alt text for languages that were not originally available in the Imageshop service.

Overrides are stored separately from the text synced from Imageshop, so running the metadata sync never destroys them. The text from Imageshop is shown as the field's placeholder; leave the field empty to use it, or type to override it for this element only. image.getAltText() and image.getDescription() return the override when one exists and the synced text otherwise. image.getSyncedAltText() and image.getSyncedDescription() always return the Imageshop text, and image.hasOverride('altText') tells you which one you got.

Note that an override cannot blank out a synced value: an empty field means "use the Imageshop text".

Per-site language mapping

By default the plugin derives the Imageshop language code from each Craft site's language — e.g. a site whose Craft language is nb-NO reads Imageshop's no text block. If that automatic mapping isn't what you want, you can override it per site.

Go to Settings → Plugins → Imageshop and scroll to Site language mappings. Each Craft site is listed with a text input; the placeholder shows the auto-derived code. Enter the Imageshop language code you want that site to use (for example, nn for a Bokmål Craft site that should display Nynorsk metadata, or en for a Swedish site as a fallback when no Swedish texts exist in Imageshop). Leave an input empty to keep the auto-derived code.

The mapping applies everywhere the plugin resolves a site's language:

Passing an explicit language to a model getter (e.g. image.getAltText('en')) still works and takes precedence over the per-site mapping — it's only the default, site-derived code that's overridden.

Templating:

Plain and simple

Please note the getAltText() method which uses image alt text for the current site language. You can also use getDescription() method to grab image description.

Note: Just like templating an assets field, the field will always return an array.

Multiple images

Using Imager

Single size

Multiple sizes

Responsive images with srcset

Focal Point

The Imageshop picker lets editors set a focal point on images ("Lagre fokuspunkt"). The plugin exposes this as CSS-ready percentage values so that object-fit: cover crops around the subject instead of dead-center.

image.focalPoint returns an object with x and y values (0–100, matching CSS object-position percentages), or null if no focal point has been set.

Setting a focal point

  1. Open the Imageshop picker for an image in the control panel.
  2. Click the focal point button ("Lagre fokuspunkt") and click on the desired focus area.
  3. Save the entry — the focal point coordinates are stored alongside the image data.

Basic usage

Multiple images

As a CSS class helper

If you prefer keeping styles out of your markup, you can output a <style> block or use a CSS variable:

GraphQL

The focalPoint field is available in GraphQL queries — see the GraphQL section for the full field reference.

GraphQL

The Imageshop field is fully available through Craft's GraphQL API. All text metadata fields resolve to the correct language based on the queried site.

Available fields

Field Type Description
url String Full image URL
altText String Alt text for the current site language
description String Image description for the current site language
title String Image title for the current site language
credits String Credits/attribution for the current site language
rights String Rights/licensing info for the current site language
tags [String] Tags for the current site language
width String Image width
height String Image height
code String Image code
documentId String Imageshop document ID
data String Raw JSON data
resizedUrl(width: Int!, height: Int) String Resized CDN URL at the given dimensions
focalPoint String JSON with x/y percentages (0–100), or null

Example query

Multi-site language resolution

When you query entries for a specific site (e.g. site: "norwegian"), all text fields automatically return content in that site's language. No extra arguments are needed — the language is determined by the site context of the query.

Available attributes

is the name of the field in these examples.

Sync metadata utility

Imageshop provides a utility tool for updating image metadata.

To access it, go to Utilities → Imageshop, and click Sync metadata.

The sync runs in two phases:

  1. Fetch changes — The plugin calls the Imageshop API to find all documents that have changed since the last sync. For each changed document that is actually used in your content, it fetches the latest metadata in every relevant language: the languages already present in the stored value plus the Imageshop language of every Craft site.
  2. Update elements — A queue job is created for each element and site that uses one of the changed documents. The job updates the stored metadata (alt text, description, credits, rights, tags and title) and saves the element through Craft's element lifecycle, so element caches (including the owner of a nested entry or Matrix block), the search index and afterSave listeners such as Blitz are all refreshed. dateUpdated is left untouched.

Alt text and descriptions entered in Craft are stored as local overrides and are never overwritten by the sync.

Flash messages confirm how many jobs were queued, or report that no changes were found.

Running the sync from the command line

The same sync is available as a console command, which is the way to keep metadata in step with Imageshop automatically:

A typical cron entry, running every 15 minutes without depending on a queue runner:

Updating from 3.2.x adds columns to the imageshop-dam_sync table; run php craft migrate/all after composer update.

Exit codes: 0 for a successful or no-change run, 75 (temporary failure) when some requests or saves failed and will be retried, 69 (unavailable) when the Imageshop API could not be reached at all.

Sync history

Each sync run is logged and displayed in a Sync history table directly on the utility page. The table shows:

Column Description
Date When the sync was triggered
Documents changed Number of documents fetched from the API
Elements Number of element/site combinations queued (or updated, for --inline runs)
Status Success, No changes, Partial (some document requests failed; the run is retried from the same point next time) or Failed (the API was unreachable; nothing was changed)

A run that cannot reach the API does not advance the sync window, so documents changed during an outage are picked up by the next successful run. Each run stores its own snapshot of fetched metadata (the last 100 are kept), and queued jobs read the snapshot of the run that created them, so starting another sync while jobs are still queued cannot make them skip documents. A job whose snapshot has been pruned refetches its documents from the API. A job whose element cannot be saved (for example because another plugin's save hook declined) fails visibly in the queue and can be retried from there; in --inline runs such a failure marks the run Partial and holds the sync window so the element is retried next run.

The log keeps the most recent 20 entries and prunes older ones automatically.

When to use

Multi-language sync

The sync fetches document metadata once per language: every language already present in the stored value, plus the Imageshop language of each Craft site. All language variants (English, Norwegian, Swedish, etc.) are updated in a single run, and a language that was missing from an image gets a new text block.

Using Imageshop Field as an OpenGraph Image Source (SEOmatic)

An Imageshop field can be used as the source for OpenGraph and Twitter Card images via the SEOmatic plugin. When configured, the plugin automatically sets og:image, twitter:image, and seo:image meta tags, including image dimensions and alt text.

Requirements

Setup

  1. Go to Settings -> Plugins -> Imageshop DAM in the control panel.
  2. Under ”Imageshop field used to generate OpenGraph image”, select the Imageshop field that should provide the image (e.g. your “Hero Image” field).
  3. The selected field must be assigned to the field layout of the element types (Entries, Categories, etc.) where you want the OpenGraph image to appear. The first image from the field will be used.

Default / fallback image

You can configure a fallback image that is used when:

To set a fallback:

  1. In the Imageshop plugin settings, under ”Global set which will be used as source for the default OpenGraph image”, select a Global Set.
  2. Make sure the same Imageshop field (from step 2 above) is assigned to that Global Set's field layout and has an image selected.

What gets set

When an Imageshop image is found, the following SEOmatic meta tags are set automatically:

Meta tag Value
og:image / twitter:image Image URL
og:image:width / twitter:image:width Image width (if available)
og:image:height / twitter:image:height Image height (if available)
og:image:alt / twitter:image:alt Alt text for the current site language

CP preview

The SEO Preview sidebar in the entry editor will show the Imageshop image in the Twitter and Facebook card previews, so editors can verify the social sharing appearance before publishing.

Complete SEOmatic + Multi-Site Setup

The ImageShop plugin and SEOmatic each handle different parts of your page's social sharing metadata. Both must be configured for complete OpenGraph / Twitter Card output.

Division of responsibility:

Meta Tag Source Configuration
og:image / twitter:image ImageShop plugin Plugin settings → OpenGraph field
og:image:alt ImageShop plugin Automatic from ImageShop API (per-language)
og:image:width / og:image:height ImageShop plugin Automatic from image data
og:title SEOmatic SEOmatic → Content → section → Title Source
og:description SEOmatic SEOmatic → Content → section → Description Source
og:type SEOmatic SEOmatic → Content → section → OG Type
og:url, og:locale SEOmatic Automatic from site/entry URL

Configuring SEOmatic per section

In the control panel, go to SEOmatic → Content SEO, then click the section you want to configure (e.g. "Blog"):

  1. SEO Description Source — set to "From Custom" and enter a Twig template referencing your description field, e.g. {entry.summary} or {entry.description}.
  2. SEO Title Source — typically "From Field" using the entry title, or "From Custom" for a custom pattern.
  3. OpenGraph Title / Description — set to "Same as SEO Title" / "Same as SEO Description" to inherit from the SEO settings above.
  4. OpenGraph Type — use article for blog/news sections, website for homepage or static page sections.

Repeat for each section that should have social sharing metadata.

Multi-site configuration

SEOmatic stores its meta bundles per site. Each site needs its own configuration:

  1. In SEOmatic → Content SEO, use the site switcher dropdown (top-left of the CP) to switch between sites.
  2. Configure each section's SEO/OG settings for that site (title source, description source, etc.).
  3. The ImageShop field must be set to translatable (per-site) so each site can have its own alt text and description. Alt text language is resolved automatically from the current site — no extra configuration is needed.

URI format tip for translated sites: If the translated site's baseUrl already includes a language prefix (e.g. https://example.com/no/), the section URI formats should not repeat the prefix. Use blog/{slug}, not no/blog/{slug}.

Verifying the complete setup

After configuring both plugins, check the rendered HTML to confirm all expected tags are present:

For a blog post, you should see:

If any tags are missing, check that the corresponding plugin (ImageShop or SEOmatic) is configured for that section and site.

High-Quality Image Permalinks

The plugin provides an API endpoint for generating high-quality image URLs on-demand via the Imageshop Permalink API. This is useful for lightbox/modal popups where you want to show a higher resolution version than the default field image.

How it works

Imageshop fields store images at the resolution configured in the field settings (e.g. 1920px wide). The permalink endpoint lets you request a larger version (default 3840px) from the Imageshop CDN, returning a permanent URL.

Endpoint

Parameter Type Required Default Description
documentId integer Yes — The Imageshop document ID (image.documentId)
width integer No 3840 Desired image width in pixels
height integer No 0 Desired image height (0 = auto/proportional)

Returns JSON:

This endpoint is publicly accessible (no authentication required) and is designed to be called from frontend JavaScript.

Example: Gallery with lightbox

This example shows a gallery grid with thumbnail-quality images. When an image is clicked, the stored image is shown immediately in a modal, and a high-quality version is fetched in the background and swapped in once loaded.

Key points:


All versions of imageshop with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^4.0.0 || ^5.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package webdna/imageshop contains the following files

Loading the files please wait ...