Wordpress 3.2.1 Featured Image Size and Crop - image

I need help finding where and how to change the size and crop of a featured image within a post. I've looked in functions.php and init.php, but with no success. I'm using a child theme of the inLine theme.
The current height is set for 130px.
I've tried changing the css, but that only stretches the image.

Do this in functions.php:
add_image_size( 'name-of-your-image-size', 600, 300, true );
Or if you'd rather use a plugin-
http://wordpress.org/extend/plugins/additional-image-sizes-zui/
And then in your post, retrieve it like so in your single.php or loop:
<?php the_post_thumbnail('name-of-your-image-size'); ?>

In your functions.php, paste one of these and adjust pixel width and height to your liking:
set_post_thumbnail_size( 100, 100 ); // 100 pixels wide by 100 pixels tall, box resize mode
OR:
set_post_thumbnail_size( 100, 100, true ); // 100 pixels wide by 100 pixels tall, hard crop mode

Related

crop image and display cropped image in axes

i have an image and i want to crop it i applied this code but its only cropping the image but not showing the cropped image on the axes :
imrect(Iedge2)
hPlot = plot(xBox, yBox);
pause(2)
delete(hPlot)
cla('reset')
imshow(I, []); % No need to specify 'Parent' now.
title('Cropped Image', 'FontSize', 12);
i want to show the message on the top of the axes area that "crop the image" when the crop process occurs and after selection of the area the cropped area will be shown to the `axes2 .some body please tell me is there is any function or method to do so?
thanks and regards`

powershell image transformation

I want to perform image transformation in powershell. Basically I want to insert a circle that contains different ratios of red/blue/green and yellow (this varies from picture to picture) onto another picture.
Right now I've stubmeld upon PSImageTools (http://psimagetools.start-automating.com/), but as far as I can tell, they only allow me to overlay one picture on to another, but since the ratios of the 4 colours vary, I have to dynamically create a circle that can be mapped onto the existing picture.
How can I perform the hardcore pixel that I require, not just pasting 2 images together, but defining the colour of the single pixel in powershell?
The following makes edits to an image:
$imageOld = "C:\My\File.jpg"
$imagenew = "C:\My\File2.jpg"
# Load the System.Windows.Forms library
[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms");
$image = [System.Drawing.Image]::FromFile($imageOld)
$graphics = [System.Drawing.Graphics]::FromImage($image)
# 50% transparent white
$color = [System.Drawing.Color]::FromArgb(128, 255, 255, 255)
$brush = New-Object System.Drawing.SolidBrush($color)
# Draw a 500px circle located at (300, 300)
$graphics.FillEllipse($brush, 300, 300, 500, 500)
$image.Save($imageNew)

How to maintain and apply aspect ratio of images in extjs4

I am working in extjs4. I am trying to display image by using following component=
xtype : 'image',
height : 600,
width : 800,
src :me.imageSrc
Where,me.imageSrc is having image path. But sometimes image is shown as blurred or expanded if image's height and width is too large. So how to calculate aspect ratio and apply it in extjs4 in order to show images properly.
In order to get the size of the loaded image you need to listen the "load" event on the image element, in the listener callback you have access to the with and height.
Here's the code that makes the magic:
var img = imageCmp.imgEl
img.on('load',function(){
Ext.Msg.alert('IMG Size',img.getWidth()+'x'+img.getHeight());
});
Here's a working example:
http://jsfiddle.net/crysfel/utUA2/
Make sure you remove the hardcoded width and height ;)

Resizing images in Etalage Jquery Zoom plugin using Javascript

I am working on a webpage that lists the details of a product .
The product details include an image that can be zoomed using the Etalage Jquery Zoom plugin.
I am able to change the image that is displayed in the Etalage Jquery plugin depending on certain attributes of the product.
I am dynamically changing the images by executing the statement
$('#etalage').etalage({
show_descriptions: false,
small_thumbs: 0
}).show();
The problem is that the source image looses its assigned height and width.
I would like to know how to assign a height and width to the source image using JavaScript
after changing the image in the Etalage plugin.
Regards
Mathew
Resolved this issue by observing the values that were being assigned to the
following parameters when the size of the source image was correct.
Assigning those values while calling the show() method solved my problem
$('#etalage').etalage({
show_descriptions: false,
small_thumbs: 0,
source_image_width: 900, // The source/zoomed image width (not the frame around it) (value in pixels)
source_image_height: 1200,
thumb_image_width:480, // The large thumbnail width (excluding borders / padding) (value in pixels)
thumb_image_height: 480,
autoplay:false,
zoom_area_width: 340, // Width of the zoomed image frame (including borders, padding) (value in pixels)
zoom_area_height:495, // Height of the zoomed image frame (including borders, padding) (value in pixels / 'justify' = height of large thumb + small thumbs)
zoom_area_distance: 20,
}).show();

Cropping image with ImageScience

ImageScience is cool and light. I am using it in my sinatra app. But I can't understand how can I crop image with not square form and how can I make thumbnail with two dimensions.
As I found on ImageScience site:
ImageScience.with_image(file) do |img|
img.cropped_thumbnail(100) do |thumb|
thumb.save "#{file}_cropped.png"
end
img.thumbnail(100) do |thumb|
thumb.save "#{file}_thumb.png"
end
img.resize(100, 150) do |img2|
img2.save "#{file}_resize.png"
end
end
I can crop thumb and resize thumb only with ONE dimension but I want to use two, as in RMagick. For example I want to crop 100x200px box from image, or I want to make thumbnail with width or height not bigger then 300 (width) or 500 (height) pixels.
Use Devil instead:
Devil.with_image("horse.png") do |img|
img.crop(0, 0, 100, 100)
img.resize2(500, 500)
img.save("horse_resized.jpg", :quality => 85)
end
Wow, I've looked into ImageScience sources and found great method with_crop(left, top, right, bottom) which helped me with my problem.
http://seattlerb.rubyforge.org/image_science/ImageScience.html

Resources