Magento 2 Change image size of product detail page

Need to change product image size 850 X 750 on the product detail page
I made changes in file view.xml but width is taking randomly
product_page_image_medium width 900 and height 750

theming – How do I add CSS classes to an image field?

My goal: I’m learning drupal. I’m creating bootstrap carousel myself. Without any plugins or themes. I use default classy theme.

So far what I have done.

  1. Administration -> Configuration -> Media :: Added new image with 1000×800 with scale and crop.
  2. Administration -> Structure -> Content types :: Added new content, Has two fields banner(image) and title(text).
  3. Administration -> Structure -> Views :: I created a new view.
  4. Added this view to my template block

My Over ride:
File one: views-view-list–home-banner.html.twig

<div id="fzCarousel" class="carousel slide" data-ride="carousel">
    <ol class="carousel-indicators">
        {% for row in rows %}
            <li data-target="#fzCarousel" data-slide-to="{{ loop.index0 }}" class="{{ loop.first ? 'active' }}"></li>
            {% endfor %}
    <div class="carousel-inner">
        {% for row in rows %}
            <div{{ row.attributes.addClass( loop.first ? 'active' ) }}>
                {{- row.content -}}
        {% endfor %}
    <a class="carousel-control-prev" href="#fzCarousel" role="button" data-slide="prev">
        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
    <a class="carousel-control-next" href="#fzCarousel" role="button" data-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="sr-only">Next</span>

and File two: views-view-fields–home-banner.html.twig

{{ fields.field_banner_images.content }}

<div class="carousel-caption">
    {{ fields.field_banner_text.content }}

HINT 1: I checked Administration -> Structure -> Views many times, I can’t find any place to add css to img. Some places it adds to parent div, not for img tag.

HINT 2: This works good. The bootstrap carousel is running good. BUT

I’m not getting the exact html code what I wanted. < img > tag has different css. I can’t add css to img field. Need help.

What I wanted: I need to add css to img field in twig template code {{ fields.field_banner_images.content }} . So that In future, I can apply for other works. Not in .theme file.

I tried .theme file code too (Just for now), but it dose’nt worked for me. I don’t know what I have done wrong there.

function mhe_preprocess_field(&$vars) {
  if ($vars('element')('#field_name') == 'field_banner_images') {
    foreach($vars('items') as $key => $item){
      $vars('items')( $key )('content')('#item_attributes')('class')() = 'my_class';

Blank product Image on category page Magento 2

When i upload images from admin for a product of low size it give blank product image on category page but when i upload image of large size,then it shows properly , enter image description here

How can I deal with three arrays inside nested lobs in MATLAB to do dithering for a specific image?

i want to write function that takes an image matrix and a dithering matrix as parameters and
return the dithered image. so i need to deal with three matrices original one and dithering matrix and new one after dithering , how can i deal with this three matrices in nasted loops using matlab?

image quality – How to test two polarising filters against each other?

I bought 2 CPL polarising filters from the same manufacturer with the same characteristics. One is medium level and one is their highest level. The difference between them, as noted by the manufacturer, is the glass used. But from the price perspective the top one has double the price of the medium one.

Because I’m new to filters and for the fun of it, I wanted to test how the 2 filters differ in terms of image quality. I tried to keep all things I could think of the same for each filter: used a tripod, used artificial light, had the same amount of polarisation effect applied by using one of my monitors as a source of light reference (is this even making sense?), compared both camera jpeg and the RAW files. I even tested this outdoors but because of a windy day and clouds moving fast I felt a controlled artificial environment would work better.

After having several tries at it, I couldn’t see any quality difference between the pictures.

Given the price difference I expected to see one and since I don’t I assume that I’m not testing correctly. So, how does one test 2 polarising filters to each other?

magento2.3 – Unable to add Product image in New order Email Magento 2.3.5

I have tried below 2 solutions:

  1. Get product image for invoice email in magento 2.3

  2. (Solved) Magento 2, Add product image in all transaction emails(shipment, invoice, credit memo)

I am using Claue theme, I pasted the below code in invoice/default.phtml & order/default.phtml, then did a setup:static-content:deploy -f. Created new Order, but I do not see the product image in email only the items as shown in the image below.




$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$product_id = $_item->getProductId();
$product = $objectManager->get('MagentoCatalogModelProduct')->load($product_id);

$_imagehelper = $objectManager->get('MagentoCatalogHelperImage');
$image_url = $_imagehelper->init($product, 'cart_page_product_thumbnail')->getUrl();
<img src="<?php echo $image_url ; ?>" alt="<?php echo $product->getName(); ?>" />

This is what I see in email:

enter image description here

I am using Magento 2.3.5-p1, I am not sure if I am pasting the code in correct block. I pasted it below <tr class="bundle-item bundle-parent"> and above <td class="item-info">.

uploads – Unset image sizes before images are uploaded

I would like to unset image sizes before uploading images that are not meant to be featured images. Right now I have a clunky workflow where, whenever I upload images, I comment out the custom image sizes use for featured images, then bulk upload non-featured images. Then I uncomment those lines and then upload the featured images. I have a photosite with thousands of photos so making sure I don’t have useless image sizes for non-featured images is important.

I would like to know if there is a way to add a checkbox (probably via a plugin that I create) to the upload new media page at Dashboard > Media > Add New, when checked, it will run a simple piece of code before the media is uploaded.

This is the code I would run if he box is checked.

function disable_featured_image_sizes($sizes)
  return $sizes;
add_filter('intermediate_image_sizes_advanced', 'disable_featured_image_sizes');

My problem is I don’t know if it’s possible to add such a checkbox to the Add New Media page and, if it was possible, how to get this value in my plugin.

bash – Have backup script not run if image is restored

I have a bash script that backs up impt files such as documents, icons, etc. to a second drive.

It runs every time my computer is booted.

But every once in a blue moon, I have to restore a Redo image.

When that happens, my backup script backs up the older files overwriting the newer ones on the 2nd drive.

Is there a workaround?

image processing – Open source Software to find and extract scanned negative frames from Kodak Disc and Minox negatives

I am looking for open source software that will find negatives on a sheet of scanned negatives and extract each one. Some of these negatives are Kodak disc, so the software needs to find rectangles of arbitrary rotation, rotate the images, and create new files. All of the rectangles are the same size.

This sounds like a capstone project in a computer science image processing course. It can’t be that hard to do, and it seems like a common request, but I haven’t found anything. If I can’t find the software, what are the building blocks that I would use to write it myself?


I found this blog post which provides a ksh script that uses trigonometry to compute the location of the disc images from three control points. This is super-cool, but you need to manually find the control points. And it doesn’t work with my other negatives, which are from a minox camera.

(For those who are interested, I am scanning the Minox images by laying them flat on my Epson flatbed scanner and covering them with a block of optical glass, and then using the scanner’s transparency mode.)

php – How do I stop an Image Address from loading in the Browser?

Ultimately, I want to be able to disable the Right Click option across a website I am working on. I have managed to disable this across the Blog Content and all of the Images that appear within the Blog.

I have noticed that when you enter the Image address directly into the Browser, the Right Click still works. I have tried modifying the Code Snippets I have, as well as various Plugins, but nothing seems to work. Would it be a case that it is not possible to disable the Right Click option when loading the original image, by entering its Image address into the Browser?

Assuming this is the case, is it possible to prevent the Image from loading when entering the Image Address directly within the browser?

If there is a way, would this prevent the image from loading in Blog Posts etc too?