1

I do print render a image field in node. I´d like to have to original image size without any styles. But when i take a look on the image path, i see that the image was uploaded to folder "large" and gets a width of 480px. In Node display settings i have set the format to "Original". What else can i do to get the original size rendered? Thanks!

<?php print render($content['field_image']); ?>

Output Browser:

src="http://fake.org/sites/default/files/styles/large/public/field/image/test-image.jpg?itok=FuFLPjDI"
0

2 Answers 2

0

If Kevin solution not woring . Then you need to image field programmatically . Use file_create_url() function like this.

Load Image URI From node object

$uri = $node->field_image['und'][0]['uri'];
$url = file_create_url($uri);
print like this 
print '<img src="'.$url.'">';
1
  • Thanks for helping, now it works great! It was the second missing quotation at [und].
    – druplash
    Oct 3, 2017 at 19:01
0

This is not the original image, it is a derivative generated by image styles. Fortunately it is a quick change to tell the field what to use.

Simply go into the display settings for the node or entity outputting the image, and change the field formatter from the image style setting to just "Original Image". The same option exists in Views if you are outputting the field.

1
  • Thanks Kevin! I´ve had change the display setting to original size. Also then the images are rendered with image style. I also have delete every image in this nodes and uploaded again, but the result is the same. I´ve never had an issue like this.
    – druplash
    Oct 3, 2017 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.