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


#1

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.


#2

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!


#3

Thanks for this report.

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