Jump to content

Image field: Difference between revisions

From EPrints Documentation
Added Image as metadata field type
 
 
(One intermediate revision by the same user not shown)
Line 16: Line 16:


{| border="1" cellpadding="3" cellspacing="0"
{| border="1" cellpadding="3" cellspacing="0"
| name || default || description
! Name !! Default Value !! Required || Description || Notes
|-
|-
| '''maxwidth''' || 640 || ''''Can be overridden in the field definition.'''
| '''maxwidth''' || <tt>640</tt> || NO || Maximum width in pixels of the stored image. ||
|-
|-
| '''maxheight''' || 480 || '''Can be overridden in the field definition.'''
| '''maxheight''' || <tt>480</tt> || NO || Maximum height in pixels of the stored image. ||
|}
|}



Latest revision as of 23:25, 11 April 2023


Description[edit]

This field store images encoded as base64 data. This may be useful for logos, icons, avatars, etc.

Inheritance[edit]

Additional Properties[edit]

As for Base64 fields except for:

Name Default Value Required Description Notes
maxwidth 640 NO Maximum width in pixels of the stored image.
maxheight 480 NO Maximum height in pixels of the stored image.

Required Phrases[edit]

No additional phrases beyond those required for Base64 fields.

Database[edit]

Image fields are stored in the database as

 fieldname LONGTEXT

API[edit]

See API page.

Examples[edit]

Most basic example.

{
   name => 'picture',
   type => 'image',
}

Sets bespoke maximum width and height.

{
   name => 'icon',
   type => 'image',
   maxwidth => '64',
   maxheight => '64',
}