Well. I am working on my first magento web site.I am using magento V1.9.2.4 with luxury theme V1.2.4
Its all working fine but Product image.(I am working on localhost xampp )
I uploaded Images trough Catalog -> manage product -> myProduct -> Images -> upload image. Then selected the image Base image, Small image, Thumbnail in the image option.
As it wasnt visible by this so i changed php_value memory_limit 512M in .htaccess file in my root. this method is not worked.
As I am working on windows i tried to give full permissions to the media folder in the root. still nothing
I also checked if Image attribute have scope global.
I tried using almost all image sizes viz 100X100 200X200 400X400... but still its not working.
what i have to do in this case?
If it helps when i upload 'x' number of images in my back-end. Magento displays 'x' number of product images thumbnails(dummy image) in my front-end product landing page
Edit::
I Narrow Down the problem
in here resize function if I give manual height and width It shows image fine. what is the problem with it now?
like this resize($size[100], $size[100]);
<img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile())->resize($size['width'], $size['height']); ?>" alt="<?php echo $this->escapeHtml($_image->getLabel()) ?>" />
Related
I am trying to use the nuxt.js Nuxt.js content module. Is there a way to display images we refer to in our blogpost.md file? I know that we can put images in the front matter, but I want the create of the articles to put images inside their created .md file. Lets say we have a file:
-- start of .md file --
# some text
some description
![Image of test](../../assets/images/test.jpg)
![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png)# some text
some description
-- end of .md file --
I end up seeing the image that is linked using https. But the other image is not displayed?? When checking the page I see an <img> tag is created, but no image to be seen...
When I check the structure using any other markdown editor, I see the image.
Including links to images does display images. But I need to include locally stored images.
any help greatly appreciated
Partially solving the issue, some images can be added using metadata (like cover images), those cannot be added within the content itself, just above or bellow actual content.
---
title: Sample
image: test.jpg
---
Here the markdown (without images)
In the view you can render that image after or before the content using something like:
<img :src="require(`~/assets/images/${ page.image }`)">
<nuxt-content :document="page"/>
I'm trying to post a picture to a file on my Gitlab using markdown
![](test/media/screenshot.png)
seems to work but is far too large.
Other solutions I've tried and don't seem to work are as follows:
<img src="https://gitlab.com/example/screenshot" width="48">
![](test/media/screenshot.png =100x20)
![](test/media/screenshot.png =250x)
<img src="https://gitlab.com/example/screenshot" alt="Drawing" style="width: 200px;"/>
Any ideas on what I can do rather than re-sizing every image I have?
Raw HTML works
Try the following: after uploading your image, use img tag with src pointing to the path of uploaded image, for me it's working:
The following is from one of my files
![](/uploads/d19fcc3d3b4d313c8cd7960a343463b6/table.png)
<img src="/uploads/d19fcc3d3b4d313c8cd7960a343463b6/table.png" width="120" height="120">
Check this link, where I've put different size of same image https://gitlab.com/Basel.issmail/resize-image/wikis/resizing-image
There is an issue on gitlab discuss Add control over images with Markdown
GitLab 15.7 (December 2022) adds an official support for this:
Change the dimensions of images in Markdown
Before this release, there were no controls for changing the size
of images rendered within Markdown text areas.
This often led to unwieldy images with no control over how much space they took up in descriptions and comments.
You can now set the width and height of how images are rendered directly
in Markdown by appending the {width=x height=y} attributes to the image reference. Sizes can be specified with pixels or percentages.
See Documentation and Issue.
Following code give good result: (the URL set in tag is the one generated by Gitlab when attaching a image)
![]() <img src="/uploads/d19fcc3d3b4d313c8cd7960a343463b6/table.png" width="120">
It shows a clickable thumbail with a fixed width (and keep image ratio).
I am inspecting a portal's page for loading of images ,its loading very slow.
We pick images from a filesystem , images name from database and read them, create a list and show results using a4j:mediaOutput tag. but the images are being loaded very slowly.
http://www.easyrenting.com/list-detail/3bhk-ardee-city-sector-52/6263
The first problem I see is that all your pictures are high-res (1800px x 2400px).
You really should create thumbnails server side to meet your view requirement and load images according of the size you want to show on the client size.
Have you only verified that your web page weight about 6.5MB including all images? (Check with Firebug).
I would recommand you a custom servlet like this one FileServlet supporting resume and caching with GZIP, and create a URL pattern according to load full res or thumbnail depending of the requirement.
There is no problem using the a4j:mediaOutput tag.
The images are getting loaded slowly because the size is too large, you need to find out a way to optimize the image size. Probably you can re-size the images before saving it to your file system.
Unless you are giving the zoom functionality, you do not need these big images.
That should help!
I have created a file upload function which saves all the uploads to a certain place:
private String destination = "D:/Documents/NetBeansProjects/FileUpload/uploadedDocuments/";
Is this a good place to store it? Should I store it some where else?
Is it possible that once the upload is complete for a page to be displayed showing the user what they have just uploaded, like a box below showing a preview? And how would I go about doing this? I am new.
I have figured it out how to display a plain txt file and an image, however it is the pdf that is confusing me.
As to the upload location, which seems to be the IDE project folder, that's absolutely not right. You should choose a configureable and fixed location somewhere outside the IDE project folder. You should not rely on using getRealPath() or relative paths in java.io.File. It would make your webapp unportable. See also this related question: Uploaded image only available after refreshing the page.
Whatever way you choose based on the information provided in the answer of the aforementioned question (and all links therein), you should ultimately end up having a valid URL pointing to the PDF file in question such as http://example.com/files/some.pdf.
Then, you can serve the PDF file on a webpage using either an <iframe>:
<iframe src="/files/some.pdf" width="600" height="400"></iframe>
Or an <object>:
<object data="/files/some.pdf" type="application/pdf" width="600" height="400">
some.pdf <!-- This link will only show up when the browser doesn't support showing PDF. -->
</object>
Keep in mind that showing PDFs in a browser is only supported in browsers having Adobe Reader plugin. Note that the <object> approach will gracefully degrade to a link when the browser doesn't support displaying application/pdf content.
I have a blog that uses Channel Images to upload and manage images. The content area is a WYGWAM field. I have a few sizes set up in Channel Images to allow the user to adjust the layout inside their content (landscape left, landscape right, portrait left, portrait right) when adding images to the WYGWAM content field. I then have two other sizes: thumb and gallery. These are for the image gallery that appears below the content. Thumb is set as the small preview in the field settings, and gallery is set as the big preview in the field settings. It all works great in the CP publish form.
However, when using the Safecracker form things don't work as well. I can select existing images, but when I add a photo to the content field (WYGWAM) it does not resize it properly. I do get the dialog box and options I want to choose from, but that choice is not being saved.
What happens is the image is added to the WYGWAM content using the size I have selected in the field settings as the big preview. I tested this by changing what size is selected for "big preview".
However, if I upload a new image and select a size it works fine. The issue is only with existing images (ie uploaded previously for other entries).
Is it possible to use sizes in Channel Images/safecracker/wygwam?
It was a bug in the most recent build. The developer has sent me a patched version that is working.