Orchard Blog Post Media Picker Image Resized - image

I've spent about 3 hrs last night trying to determine why the image that I upload via the Media Library Picker field keeps resizing to 200x200 when it is displayed in a blog post.
Its not resized after upload and if I insert that same image into the blog post it retains the original size.
I haven't done anything special, I just edited the Blog Post content definition by adding the Media Library Picker field. When I create new blog post, I click the Add button to select the media and then publish the post.
See sample screencap: http://imgur.com/Ju3Sryp
Thanks for the input!

By default, when you are displaying a media library picker field, it gets rendered by Modules/Orchard.MediaLibrary/Views/FieldsMediaLibraryPicker.cshtml. That template loops over the media parts in the field, and calls Display(BuildDisplay(content, "Summary")). That builds the shapes for each of the media content items pointed to by the field. One of these shapes is going to be a Parts_Image shape in your case. Notice that in the BuildDisplay call, a "Summary" display type was passed in. That means that the Parts/Image.Summary.cshtml template is going to be used to render each image. That template has the following code to render the image:
<img width="200" height="200" alt="#mediaPart.AlternateText"
src="#Display.ResizeMediaUrl(
Width: 200, Height: 200, Mode: "crop",
Alignment: "middlecenter", Path: mediaPart.MediaUrl)" />
This is what resizes the image to a 200x200 cropped thumbnail.
If that's not what you want, you'll have to override one of those templates. I'd recommend creating an alternate for FieldsMediaLibraryPicker.cshtml for the specific filed name that you've been using, and in the code, change the display type from "Summary" to "Detail". This way, the Image.cshtml will get used for each image, and that will not do any resizing.

Image resizes into shape by default. You should enable Shape Tracing Module than reload your page than expand shape tracing tool from page bottom than click on the image than create and change alternate.

Related

How to add clickable, expandable picture via a thumbnail on Markdown?

I am trying to add an image on a page on my docusaurus website, I want to keep the photo high-def and want to show an initial thumbnail that is clickable that expands to the full-size high definition image. I have found how to link the picture to an external webpage, but I want the image to open as a function on the page the picture exists on.

Change background color of transparent PNG images uploaded to blogger

I have a blog hosted by Blogger with a custom template: http://www.drugchannels.net/
Images uploaded to the blog are hosted at X.bp.blogspot.com (where X is a number). Examples:
https://1.bp.blogspot.com/-Jwy2VQYRIEA/WqmwvsA07WI/AAAAAAAATA4/jWVcEts1h1Y4IXM0hD0njUhSmQ2AZPnxQCLcBGAs/s1600/Specialty_vs_Retail-2014_vs_2017.png
https://4.bp.blogspot.com/-O4S9ps4u67k/Wk0yhTEuV-I/AAAAAAAASUE/5tPedr-p7_4kedNYU4RY711l6K3maokiQCLcBGAs/s1600/DCI-Copay_Accumulator-03Jan2018-CORRECTED.png
I want to have a white background when the image is clicked. (The images look fine on the site itself. This is not a problem with the blog's background, which is set to be solid white.)
Using the Inspect option in Chrome, I see the following information
The body formatting (background: #0e0e0e;) does NOT appear anywhere on my blog or in my template.
How can I fix?
Thank you!
P.S. I have 10 years of legacy posts with images, so I need a global solution that changes the background to white for all images posted to the blog.
Wrap the image in a div and set the background color of that div with css. That should work
.divclass:active {
background:#FFFFFF
}
If you are opening the images in a new tab or window then your only option is changing the background of the images yourself with a photo editor. If you're just trying to give the user a full size view of an image when they click it you could use javascript/jquery and have a full size div with a background and an image pop up in full screen without sending them to the linked image. Theres probably quite a few jquery plugins that will do this with minimal coding knowledge, just google it.
Thanks, Riley.
I can't go back and edit hundreds of images, so the photo editor option won't work.
But based on your suggestion, I used the following solution:
1) Enabled "Showcase Images with Lightbox" on blogger
2) Added CSS from this page (http://www.howbloggerz.com/2016/05/how-to-customize-blogger-lightbox.html) with no background image and background color set ot white (#ffffff).
Downside is that charts/images now pop up on same page rather than opening in a new tab.
Thank you!

Image not displaying correctly using POST messages.json API

Posting content to Yammer was a feature we'd successfully implemented a while back but now we are getting reports that the image is broken and showing a grey jigsaw. As well as this we noticed Yammer have changed the layout of posts. We originally were using a profile image, which would now look ridiculous with the layout changing to a squarer rectangle with a large image behind it.
This is the image:
https://cli-cdn.release.workstars.net/jantestvr-3ntsv7ypjestvj0e/employee_images/FzAhje2Cf6gdSKiNkMlEGTZQPvHI5Ju0BxDq7.png
This is url that produces the jigsaw:
https://thumbnails.yammer.com/preview?url=https%3A%2F%2Fcli-cdn.release.workstars.net%2Fjantestvr-3ntsv7ypjestvj0e%2Femployee_images%2FFzAhje2Cf6gdSKiNkMlEGTZQPvHI5Ju0BxDq7.png&signature=RJK%2Fo8yt2vv6DeXXtLrKa5%2BWThnUoXdWAHSIYLPNYqI%3D
Has something changed in the way you need to encode the POST data? I can't get anything other than a jigsaw trying things with the url manually. Also, any way to force the original layout of a full width rectangle with a square image floated inside to the left?

Parsys on top of an image

There is requirement where parsys should be added on top of an image. It is like a background image with the provision of parsys so that other components can be dragged and dropped on top of it. I am using html5smartimage for image component. But, no clue yet on how I can get the parsys on top of the image. Please help if you find any ideas. Thanks.
is the image authorable? If so, how do you intend to provide click-area for the authors to change the image vs edit items in the parsys.
If the image isn't authorable, just target the CSS for your parsys and set the image.
If the image is authorable, in edit mode you want the image to be distinct from the parsys and have separate clickable areas. Then in preview/disabled modes you would generate the actually desired markup & CSS to position the parsys content over the background image.

drupal image in view is displayed full screen, how to get the image smaller?

We have got a view of a content type with an image and some fields, but the image is displayed way to large. We tried to adjust maximum resolution but that just crops the image and makes it pixelated. How can we get this image to be displayed smaller?
thanks.
In Drupal 7, you can use the core Image Styles (admin/config/media/image-styles) to set pre-defined image sizes, cropping, and more. Once you have an image style configured, you can use it to style an image in a view. This gives you complete control over image cropping and sizing. If you're using Drupal 6, the ImageCache module does the same thing.

Resources