click on "product image", you can see image ,image will expand with original size [lightbox image]
I want to restrict that lightbox image size to 1200 in product view page in magento.
please see below media.phtml file
media.phtml file = http://pastebin.com/8yaDrs8Q
help me to restrict the lightbox image size for 1200.
let me know if you need any clarifications,
thanks in advance,....
Image size has been taken through css and js file not from media.phtml.
You should change lightbox.js. Above given link clearly suggest you how to do it. If you don't want to make any changes than just follow below steps.
Just replace your lightbox.js with LightboxXL.js and css file also.
This script has built in image resize function. Download LightboxXL.js from here-->> http://www.ramirezcobos.com/labs/lightboxxl-for-prototype/
Related
What is the best way to fit an image for thumbnail example 200px x 200px ?
after researching here are the best options I found:
save 2 set of images for thumbnail and large slideshow purpose, for example if user uploads img001 , then save 2 copies of the same image one for thumbnail(resized 200px x 200px) and one for large slideshow purpose(actual dimension).
just use one image and use it responsive with 100% width and 200px height(for thumbnail) and let the large image be itself.
with solution 2 I found that the thumbnail image always look shrunk.
Please give some suggestions on dealing with thumbnail images, thanks in advance
Here is what i suggest.
Store only one original image at the time of saving.
Maintain a Cache folder for your images in such a way that the cached images are created whenever you need to display on whatever size you want.
eg : make a function something like
getCachedImage($post->image, '200x200-','200','200')
and inside that function you can have some logic to save a precise sized
image you want inside cache folder. Dont forget to check if the following size image is already been saved. You can use size as prefix ('200x200-$fileName') as i have mentioned on example. I use Image Intervention Package for my laravel project to save those picture in the size i want it to display.
Now you can call this function in your view wherever you need to display an image and you can call any size image you want.
You will always have shrunk image if you use your option number 2.
And Even in your option 1, if you saved one extra image as thumbnail you will never have exact needed size for you thumbnail, so at some place this thumbnail is also gonna shrink.
I want to show images like google search images.like when someone click on a particular image the thumb image get load first until the actual image get loaded,when the the actual image gets loaded the thumb is replaced by the actual image.
Please help me.Any help will be greatly appreciated.
First you must know if you image is already loaded than you will replace it.
$('img.mustLoad').on('load',function(){
/* Fire your image resize or thumb replacement code here */
});
I have a question about wordpress slider plugin Cyclone2.
Problem is that when I upload and add an image to slider, it outputs incorrect src url for img tag on site page, like adding slider width and height to image url..
Ex. I upload image Champagne-All-Bottles.jpg.
In admin panel image loads successfuly: /wp-content/uploads/2015/12/Champagne-All-Bottles.jpg
but on site page it adds a width and height to img url like: /wp-content/uploads/2015/12/Champagne-All-Bottles-1200x400.jpg
HTML admin panel(correct):
HTML output on site page(incorrect url):
This plugin probaly makes an 1200*400 picture copy of the one you are giving because somewhere in the settings you say that the slider should be 1200*400 pixels. So the plugin is transforming your picture to the dimensions of the slider. Is there somewhere in the settings of the plugin something where you can adjust the dimensions?
A lot of WordPress plugins do this, and even WordPress itself is doing this. Making different dimension copies of images you upload.
EDIT: I searched the plugin you are talking about and in I think in basic settings the "width" and "height" are there so you can change the dimensions. But one thing, all images uploaded will get the same dimensions, thats how this (and a lot of other) WordPress plugin works.
Note: if you set "Width Management" to fixed, the plugin probably stops resizing your image, can you give it a try?
-Resize Images?
-No, shut up!
#TotalCare, thank you for your help :)
I'm having an issue with the featured images that are being generated (cropped and resized) by the TimThumb script.
Is there a way to tell the script that I want the images to be a specific width (with no cropping) and then have an auto height to retain the correct proportion?
Here is a link to the site I'm referring to: http://aquariuscocktail.com
If you scroll down a bit you will see a post by the name of "Baby Blues" with a picture underneath. That picture is getting cropped and blown up larger because of TimThumb and I can't seem to figure out why or how.
Here is the URL it's generating:
http://aquariuscocktail.com/wp-content/themes/writer-parent/framework/timthumb/timthumb.php?src=http%3A%2F%2Faquariuscocktail.com%2Fwp-content%2Fuploads%2F2013%2F11%2Ftester.jpg&h=670&w=670&zc=1&q=100
The original dimensions of the uploaded image are 670 x 476
Any help would be greatly appreciated!
Thanks,
Patrick
You can do away with timthumb and use the built in functions of WordPress to display images on your home page sized correctly. This reduces load on your server and can help prevent malware if your version or future versions of timthumb become vulnerable to XSS
Add a new image size to your site add_image_size( 'home-post-featured', 670, 9999, false );
Use Regenerate Thumbnails, then replace the timthumb code in your template to use the_post_thumbnail()
** EDIT **
Another problem is this image http://aquariuscocktail.com/wp-content/uploads/2013/10/AQC-shop-538x1024.png is not 670 wide, so distortion is coming from the width stretching as well as the height. Make sure you are uploading images 640 wide and you use the full size image.
When clicking on images in my posts it takes me to the attachment post of the image. From there I have to click the image again to get the full size. Instead I want to go directly to the full size image in uploads. Is there a function that will do that?
In the Media Upload, if you choose "File URL", it will link to the full-sized image.
If you want this to be the default behavior, you can either by changing the options directly in the dashboard, or by adding some code to your theme.
To do it by changing the option in the dashboard, visit this link for instructions:
http://blog.aizatto.com/2010/05/04/changing-default-wordpress-media-link-url/
To do it by adding some code to your theme, check out this article:
http://andrewnorcross.com/tutorials/functions-file/stop-hyperlinking-images/