Hello,
I am facing an issue with the file getting displayed on the node add/edit page as preview when the file is added in custom file type.

Scenario:
I have created new file type as responsive image.
Then I created a field of type image in content type.
When I add image from my system it does not get displayed on node add/edit page as preview.

CommentFileSizeAuthor
Drupal isssue.png44.15 KBkaustubhb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kaustubhb created an issue. See original summary.

noopal’s picture

Hi, I have the same problem.

How can I display an image instead of a link?

Thanks

joseph.olstad’s picture

inspect the image element, get the path to the image, does your web server have read/write/execute permissions on the sites/default/files/styles folder ?

the folder that stores this image in the styles folder, in there will be a thumbnail folder ,

also, check your image styles, if you're missing the thumbnail square image style, this could be what you need, create the exact same machine name image style as requested by the url when you inspect that image it's part of the path parameter, that image style must be present.

see this related issue if you still haven't figured this out.

#2486599: missing square_thumbnail causes Broken images in media browser and file/thumbnail

joseph.olstad’s picture

joseph.olstad’s picture

Status: Active » Postponed (maintainer needs more info)
noopal’s picture

Hi Joseph.

Thank you for taking the time to reply.

No image is loaded. The html is as below.

<span class="file">
  <img class="file-icon" alt="Image icon" title="image/jpeg" src="/modules/file/icons/image-x-generic.png"> 
  <a href="/sites/image.jpg" type="image/jpeg; length=47112">image.jpg</a>
</span>

Image icon
image.jpg

Its a default icon for a file with the a link rather than rendered as an image. As far as I am aware I havent changed any settings.
However I am sure in previous installations the upload showed a preview of the image rather than a link to the image.

Maybe I have accidently changed something?