New module: Alt Text: Specify custom alt text for media

I just published a small new module for Omeka S called Alt Text.

It simply adds a new tab to the edit form for media allowing a user to input text that will be used as the alt attribute when the media is rendered as an image or thumbnail. Other options for deriving the alt like reading from existing metadata properties are possible (in this module or another), but currently the custom text option is all that’s implemented.

This module requires at least Omeka S 1.2.0.

1 Like

Hi John,

There seems to be an error with the Alt Text module with Omeka S version 1.3.


Omeka S encountered an error

InvalidArgumentException
Unexpected argument type.

Details:

InvalidArgumentException: Unexpected argument type. in /var/www/html/omeka-s/modules/AltText/Module.php:113
Stack trace:
#0 /var/www/html/omeka-s/modules/AltText/Module.php(56): AltText\Module->getAltTextForMedia(NULL)
#1 /var/www/html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): AltText\Module->AltText\{closure}(Object(Zend\EventManager\Event))
#2 /var/www/html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners(Object(Zend\EventManager\Event))
#3 /var/www/html/omeka-s/application/src/View/Helper/Trigger.php(61): Zend\EventManager\EventManager->triggerEvent(Object(Zend\EventManager\Event))
#4 /var/www/html/omeka-s/application/src/View/Helper/Thumbnail.php(32): Omeka\View\Helper\Trigger->__invoke('view_helper.thu...', Object(ArrayObject), true)
#5 /var/www/html/omeka-s/application/src/Api/Representation/AbstractResourceEntityRepresentation.php(535): Omeka\View\Helper\Thumbnail->__invoke(Object(Omeka\Api\Representation\ItemRepresentation), 'square')
#6 /var/www/html/omeka-s/application/view/omeka/admin/item/browse.phtml(99): Omeka\Api\Representation\AbstractResourceEntityRepresentation->linkPretty()
#7 /var/www/html/omeka-s/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php(506): include('/var/www/html/o...')
#8 /var/www/html/omeka-s/vendor/zendframework/zend-view/src/View.php(207): Zend\View\Renderer\PhpRenderer->render(NULL)
#9 /var/www/html/omeka-s/vendor/zendframework/zend-view/src/View.php(236): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#10 /var/www/html/omeka-s/vendor/zendframework/zend-view/src/View.php(200): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel))
#11 /var/www/html/omeka-s/vendor/zendframework/zend-mvc/src/View/Http/DefaultRenderingStrategy.php(105): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#12 /var/www/html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\View\Http\DefaultRenderingStrategy->render(Object(Zend\Mvc\MvcEvent))
#13 /var/www/html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent))
#14 /var/www/html/omeka-s/vendor/zendframework/zend-mvc/src/Application.php(367): Zend\EventManager\EventManager->triggerEvent(Object(Zend\Mvc\MvcEvent))
#15 /var/www/html/omeka-s/vendor/zendframework/zend-mvc/src/Application.php(348): Zend\Mvc\Application->completeRequest(Object(Zend\Mvc\MvcEvent))
#16 /var/www/html/omeka-s/index.php(21): Zend\Mvc\Application->run()
#17 {main}
Omeka S
Version 	1.3.0
PHP
Version 	7.2.10-0ubuntu0.18.04.1
SAPI 	apache2handler
Memory Limit 	128M
POST Size Limit 	100M
File Upload Limit 	200M
Garbage Collection 	Yes
Extensions 	apache2handler, bz2, calendar, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imagick, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, sockets, sodium, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib
Disabled Functions 	, pcntl_alarm, pcntl_async_signals, pcntl_exec, pcntl_fork, pcntl_getpriority, pcntl_get_last_error, pcntl_setpriority, pcntl_signal, pcntl_signal_dispatch, pcntl_signal_get_handler, pcntl_sigprocmask, pcntl_sigtimedwait, pcntl_sigwaitinfo, pcntl_strerror, pcntl_wait, pcntl_waitpid, pcntl_wexitstatus, pcntl_wifcontinued, pcntl_wifexited, pcntl_wifsignaled, pcntl_wifstopped, pcntl_wstopsig, pcntl_wtermsig
MySQL
Server Version 	5.7.24-0ubuntu0.18.04.1
Client Version 	mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $
Mode 	ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION
OS
Version 	Linux 4.15.0-39-generic x86_64

Thanks!

Thanks for this report.

Try out the just-released version 1.0.1 which should fix the problem.

Hello! I’ve been using the Alt Text module and am very glad to have it. I’ve used the CSV import module to add/edit items and media, and was thinking it would be convenient to use it for alt text as well.

Is there a way to add alt text for many items at once using another column in your CSV file? (If so, I couldn’t figure it out; if not, is that something it might be possible to add in future?)

1 Like

If the alt text for multiple images or even individual images working with Sideload could be added to the CSV import module, that would be really incredible and save a ton of time.

I’ll look into adding CSV Import support for this module: it should be possible, I’ll just have to work out some stuff on how it should work for “multivalue” columns and Item vs. Media imports

1 Like

That would be incredible! Thank you so much!