Enlarge linked images on click - image

I am saving only names of image to the database while the image themselves are saved to a folder.These images are then displayed back in a php page in reduced size using the width, height tags.
I fetch them like this:
<?php echo '<img src="./images/'.$cfilename.'" width="300" height="400" />'; ?>
Is there a script I can include in php to enlarge the previews of the images when clicked on?
I have searched the web but allI found were scripts that demonstrated image names imbeded within html.
Any suggestion?
Joseph

Related

How to change default upload sizing of Magento (1.9) product images

I'm trying to change the default upload resizing for the Small Image that is used for the catalog images.
Magento docs say to go to Config > Catalog > Catalog > Product Image
There, you can set the sizing for each type of image - Thumb, Small, Base.
I changed the Small Image size to 1000px (before it was 210px), but it is still uploading/resizing pictures to 210px. I have tried refreshing all Caches and Re-indexed, logged out and logged back in (just to cover all my bases). Each time I did these things, I re-uploaded images. I even tried uploading images with different names, just in case the image with that name was cached in my browser already.
I'm probably just doing this entirely wrong. How do I get these parameters set?
Thanks!
Nevermind, I figured it out!
Had to make an edit in the list.phtml file for my design theme:
<?php $_imgSize = 210; ?>
to
<?php $_imgSize = 1000; ?>
Open media.phtml file using a text editor of your theme and change the size of image like bolow:
$_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(300).'" alt="'.$this->escapeHtml($this->getImageLabel()).'" title="'.$this->escapeHtml($this->getImageLabel()).'" />';

How to display uploaded images in pdf using wkhtmltopdf

I am using Carrierwave to upload images in rails4.
In the html view page the image is showing. But, when generating the pdf, from this view, the image is not showing.Instead , a blank box is showing.
From the view, while inspecting the path is showing as below:
<img alt="Small images" src=" http://127.0.0.1:3000/upload_
files/6/student/image/1/small_images.jpg">
The code i used is:
<%=image_tag Student.find(id).image_url(:small) %>
If the image is stored in app/assets/images, then the images will appear.But, i need to upload the image in this location only.
Can u pls help...
Thanks in advance.
I could do it with php Laravel this way >>
<img alt="Small images" src="{{base_path().'path/to'image.jpg'}}">
I have no experiences with Ruby , but try to find something similar.

Magento Natural Images

On a category page I have a slider with images from the the sub-categories thumbnails. These images render completely very slow. In checking I see that the natural size of these images are width 403px and height 430px. When I made these images I made them width: 199px and height:300px. I tried the below but it just effects the image size rendered and does not change the natural size.
.item .category-images{
width: 199px;
height:300px;
Images for slider are being pulled from thumbnail uploaded to category in admin.
Could someone tells me where I would edit the size of the natutal image? I have looked in every file I can think of.
Thank you in advance for any help.
To modify image sizes on a category page, navigate to app\design\frontend\default\your_theme\your_template\catalog\product folder.
Open list.phtml. Search for “resize”, then edit the section that looks like this:
resize(100); ?>" width="100" height="100"
Make sure you do it in list and/or grid mode as required and refresh images cache.

Change Magento image size on search results page

I have changed the size of the images on the category pages from 135px to 400px. It now shows 3 columns with 400px images. This works fine! BUT I want the search result page to look the same as the category page. It already has 3 columns and the images are displayed as 400px. The only problem is that it still loads a 135px small image. Now the images are very blurry. How do I change this so it will load a 400px image?
Thank you
By default Magento displays the search results through the template;
app/design/frontend/YOURPACKAGE/YOURTHEME/template/catalog/product/list.phtml
I you wanted to change that then the best thing you could do is follow the advice in the following link and designate a custom template to display your results by copying and renaming the list.phtml file;
Magento design update to replace list.phtml on search results page only
You could then customise it however you want. The section you would change is the following code which, as you can see ( the ->resize(135) part) is resizing your small product image to 135px. Change that to 400 and assuming the small image itself is not smaller than 400px wide then it want be pixellated.
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
This can only be done through CSS. The CSS depends on the theme your using.

Specify Thumbnail Dimensions in Microdata for RichSnippets

I added metadata tags for our products as specified by http://schema.org, for use by RichSnippets, etc...
It works great except that our products only have 3x2 images, and google resizes them to square for the RichSnippets, which causes them to look terrible.
I've seen examples where
Is there a way to specify the dimensions of an image tagged as itemprop="thumbnailUrl" (or itemprop="image") without changing the image's actual size?
Edit: injecting PageMap (as seen in http://support.google.com/customsearch/bin/answer.py?hl=en&answer=1626955) data didn't work for me, as the rest of the page is done with microdata.
Edit: My object is http://schema.org/Recipe, which doesn't include width or height for its thumbnailUrl object.
Make a copy of your thumbnail images resized or cropped to look fine as a square, as this is what SE will show, then use the meta tag with content to specify using those thumbnails instead of the ones you show on your webpages.
e.g.
<div itemscope itemtype="http://schema.org/Recipe">
..
<meta itemprop="thumbnailUrl" content="http://my/optimized/thumbnail/url.png" />
<image src="http://this/is/the/thumbnail/not/resized.png" />
..
</div>

Resources