How to use Docker for Drupal 7 Dev envirnoment
I have been using drupal 7 from a long time, and setting up a dev environment…
April 18, 2020
I’ve been using image styles, and heavily used “Scale and crop” style, which worked for me in almost 95% of the cases. Recently, I’ve been getting images which are like horizontally long or vertically long. Default image styles could not work for any of combination.
Below is one example image, and its result (Prior to my solution)
Original Image
Poor Result
Lets take a look at how I solve this problem.
I found the two hero modules:
After installing them, Please follow the steps:
In aspect ratio: put 16:9, or you can put your desired one. Leave rest of the field as it is. Save it.
Scaling effect configuration
Final Manual Crop configuration
Now, see your content. It should work as expected.
You might have doubt for above 2nd effect (Scaling) in image style. If you leave that image style with only Manual Crop effect. Your images might display in expected size. I encountered a case where image was vertically long. For that, I had to put a scaling configuration as well. And if you noted I did not specify the width. It will automatically maintain aspect ratio. And, the max height for all images will be the value I specified.
See the results:
This example image I have put on top.
Original Image
After manual crop configuration
Original Image
After manual crop configuration
Let me know if you have any doubts in comments.
I have been using drupal 7 from a long time, and setting up a dev environment…
Introduction In Azure, assuming you are having a storage container. And, you…
I use drupal-7 in my website. I used to write articles and put images in that…
Introduction In this post, we will see how to fetch multiple credentials and…
This post will show some really awesome tricks in python. Get the power of a…
While running docker commands with some images, I started getting error: The…
Introduction In this post we will see following: How to schedule a job on cron…
Introduction There are some cases, where I need another git repository while…
Introduction In this post, we will see how to fetch multiple credentials and…
Introduction I have an automation script, that I want to run on different…
Introduction I had to write a CICD system for one of our project. I had to…
Introduction Java log4j has many ways to initialize and append the desired…