8 – How to create a view of Media images that do not have any Alt Text

For accessibility purposes I want to create a view of Media images that do not have any Alt Text.

Creating a view of Media images and also displaying Alt Text is not difficult, as explained is this d.o post Media alt text not available in Views

However I do not know of a way to create a filter of ‘Alt Text is NULL’ so that a view can be built which only returns images without alt text.

Any suggestions for how could this be accomplished? Ideally this would be a view of media entities so that other filters relating to media can also be used.

alt process – Is taking photos with the back side of a film roll a real technique?

Yes, this technique is known as redscale. You can find a decent amount of information by googling using that term, and see example photos on Flickr. As @MichaelC notes in the comments, on 35mm you’d have to figure out a way of extracting the film from the canister, invert it, and put it back.

You can even do this on B&W film, and there will be an effect, since the light will now be passing through the anti-halation layer first.

I don’t want to waste an entire film roll and realise it didn’t work.

It will work, in the sense that you will get some results out of it, but as with any alternative technique, you pretty much have to be prepared to waste rolls of film (more than one) as you experiment. 🙂 Plus, things can go wrong when unloading and reloading the film into the cartridge.

On the other hand, Lomography makes a redscale film that you load in the normal way – perhaps worth a try as a first approximation to see if you like the results.

phpunit – Using attachFileToField in a Functional test doesn’t allow entering the alt text for an image

In a Functional test, I am doing:

    $this->drupalGet('node/add/article');

    $page->fillField('title(0)(value)', 'Page 1 EN');

    $page->pressButton('Add image');
    // Using TestFileCreationTrait::getTestFiles().
    $image = current($this->getTestFiles('image'));
    $page->attachFileToField('field_image', $this->container->get('file_system')->realpath($image->uri));

This appears to work, in that if I then do:

    $page->pressButton('Save');

I get a form error because the image alt text is required.

But this doesn’t work:

    $page->fillField('field_image(0)(alt)', 'Image alt text EN');

and in the browser output, I don’t see the subfields for the image.

In FunctionalJavascript tests that use attachFileToField(), there’s typically a waitForFoo() call which waits for the form AJAX to update and show the image subfields.

But that’s not available in Functional tests, and besides, there’s no AJAX since there’s no JS.

How can I get this to work?

(I’d really rather not use drupalPost() to send a massive edit array; using Mink to fill fields one by one is much better DX I find.)

script – Alt Stack is not working as expected

I have a scenario as follows:

  • In a company, there is a manager and three employees. The multisig signature will be redeemed by the manager combined with one of the employees.
  • However, only the manager, or only the employees with enough number of signatures will not be able to redeem the transaction
  • The order of the signatures should not matter
  • Assume my_public_key is manager_public_key

My solution was: [OP_2DUP, my_public_key, OP_CHECKSIG, OP_IF, OP_DROP, OP_ELSE, my_public_key, OP_CHECKSIGVERIFY, OP_SWAP, OP_ENDIF, OP_DROP, OP_1, employee1_public_key, employee2_public_key, employee3_public_key, OP_3, OP_CHECKMULTISIG]

So I tried to shorten the script in order to have less bit in a transaction by using alt-stack.

My suggested solution is just to duplicate the my_public_key and push it into the alt-stack and whenever I need it later, I can pop it from the alt-stack and use it. So by the final script I should deduct the script by one public key.

Suggested solution: [OP_2DUP, my_public_key, OP_DUP, OP_TOALTSTACK, OP_CHECKSIG, OP_IF, OP_DROP, OP_ELSE, OP_FROMALTSTACK, OP_CHECKSIGVERIFY, OP_SWAP, OP_ENDIF, OP_DROP, OP_1, employee1_public_key, employee2_public_key, employee3_public_key, OP_3, OP_CHECKMULTISIG]

My suggested solution gives reference error.
I would be happy if anyone can help me.

Error:
{“error”: “Error validating transaction: Rejected script for input 0 referencing 5f026fb3260c809d446740917bca4aa0e8633f64ec86fc8a4c5e23979f1578ba at 0..”}

Input script:
[OP_0, manager_sig,employee_sig]

accessibility – Is alt text required for an image if the information is present elsewhere on the page?

If a sighted user can view the image and derive any kind of context or detail from it that relates to the text of the page, then you should not treat the image as uninteresting or purely decorative.

If it does have context, then to the vision impaired user of course it’s important that there is an image of the described item. After all, you wouldn’t have put it on the website if it wasn’t of some value to the sighted reader. To deny the sight impaired reader at least a description of it is a potential cause of frustration.

To not give it an alt text is to say to the reader, “It’s not important for you really – don’t worry about it.” And to the reader, this is very well may be a source of frustration. It’s not unlike a hard of hearing person getting the frustrating response, “Forget it” or “Never mind” by someone who’s asked to repeat something. Do not deny the person relying on the alt text the experience others may have who can see.

As to what the alt text should be, it depends a lot on the appearance of the item being described. If it is something like an original historical document, then you should describe it to the viewer just like you’d describe it to someone verbally. E.g., “An image of the original document, hand written on tattered paper yellowed with age”, or “Typewritten pages from diary with tear repaired with clear tape”, etc. In the case of a document also fully quoted in the page (per your example), it might help that the alt text also state that the contents of the document are available in the page.

Lastly, irrespective of context, if the image can be clicked on and a higher resolution version be viewed, both the low res/thumbnail version needs alt text, as well as the high res version. The thumbnail should describe the item enough to let the vision impaired reader have as much a reason to be interested in the detailed version as a sighted reader. And of course the detailed version should have a detailed description.

posts – Alt text attributes not showing over portfolio images

I´ve been searching almost all posts regarding this issue but haven´t found a solution for my theme. Maybe there´s a kind expert mind that can support me. I´m using a theme that doesn´t allow updates nor support. It´s a grid-based minimal design. As I´m a motion designer would like that when the viewer hover´s the cursor over the images on the page the information text displays as it used to, now it doesn´t happen anymore and I´m a bit frustrated as need showing my work to potential clients.

This is my website https://rafaelcalleja.com/ not sure if I should share anything else to get some advice?

thank you in advance for any help

seo – Google shows image alt text in the search result rather than the meta description

Google search shows random alt text of images in my site instead of the meta description tag text. I couldn’t find similar problems on the net so I guess I’m doing something wrong, but what is it?

If I delete the alt text, it shows some random text from the footer.

usability – Should html links with images have both title and alt attributes?

However, the alt description in the image should be for the link description, not for the image itself

From Accessibility and Usability at Penn State: Image ALT Tag Tips for HTML

term “ALT tag” is a common shorthand term used to refer to the ALT
attribute within in the IMG tag.

  • Any time you use an image, be sure to include an ALT tag or ALT text
    within the IMG tag. Doing so will provide a clear text alternative of
    the image for screen reader users. WCAG 2.0 Guideline 1.1.1.—”All
    non-text content that is presented to the user has a text alternative
    that serves the equivalent purpose.”
  • The description in the ALT tag

should be meaningful in the context of the Web page, specifically:

  • Images used as links should have alternative (or “alt”) text
    describing the destination of the link, not the image itself.

with acronyms should be written with spaces in between letters. For
instance, <alt=”I T S at P S U” > (read by a screen reader as “ITS at
PSU”) is preferable to <alt=”ITS at PSU” > (read as “It’s at Sue”).

  • Images used as spacers or in toolbars should have an empty ALT tag
    (i.e. <alt=”” >). Screen readers will simply skip over images with
    empty ALT tags.
  • Images that already include a text description within

the main text of the page can have a summary ALT tag.

provide a tooltip for visual browsers, use the TITLE tag in addition
to the ALT tag, since it is supported in most browsers. For example:

  • While there is no official length restriction on the length of alt
    text, many experts recommend 125 characters or fewer because of
    restrictions within the JAWS screen reader. Many versions of JAWS
    break up longer text tracts into blocks of 125 characters, which can
    be confusing to users.
  • For an especially complex image, such as a

chart, equation or diagram, a link to an extended text description
should also be included.

  • Images that are used as buttons or labels

should use fonts that are readable to a large segment of the audience
(probably 12 pixels/point or larger).

  • In some cases you can replace

decorative or layout-related images with styled HTML elements, such as
HRs or DIVs, for which you change background colors and specify
background images.

The article above clearly explains the alt usage on image links. However, the title part is incomplete in the original article, but you should use both, because one of them will help you with assistive technologies and accessibility , while the title on links will help you with this, but also with better readability and SEO.

On top of the above, you should never rely on title only, see The title attribute

Relying on the title attribute is currently discouraged as many user
agents do not expose the attribute in an accessible manner as required
by this specification (e.g. requiring a pointing device such as a
mouse to cause a tooltip to appear, which excludes keyboard-only users
and touch-only users, such as anyone with a modern phone or tablet).

but… by no adding it, you get this:

If this attribute is omitted from an element, then it implies that the
title attribute of the nearest ancestor HTML element with a title
attribute set is also relevant to this element. Setting the attribute
overrides this, explicitly stating that the advisory information of
any ancestors is not relevant to this element. Setting the attribute
to the empty string indicates that the element has no advisory
information.

You must use both elements whenever possible, but there are some specifications and special rules you should follow

Is it possible to change the Alt value inside the image.html.twig template?

Is it possible to change the alt value inside the image.html.twig template?
I found out that it can be accessed via attributes.alt. And then there is a protected value. Is there a way to set it?

Something like:

{% set attributes.alt.value = 'new alt' %}

html – Will Google Images ignore images with empty alt text?

You can put images that are just decorative into a HTML document like this, by setting their alt text to nothing:

<img src="decorative.png" alt="" />

This means that screen readers won’t announce the image, and that if the image doesn’t load, it won’t show anything.

My question is, will Google Images ignore these images as well, and will it hide them in search results?