Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
image.module
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2010 at 19:26 UTC
Updated:
15 Jan 2016 at 00:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sylvain lecoy commentedif you hack the file.fields.inc file, by changing the hook_field_formatter_info(), it work out of the box. Instead of having the image, you have the url of the original file. That mean we have to handle the style and output the right link.
Comment #2
sylvain lecoy commentedHere is the code to implements in a module if you want a quick work around:
I think this need some review, but it is pretty straightforward to integrate in the image field.
Comment #3
sylvain lecoy commentedAttached a simplier solution
Comment #4
sylvain lecoy commentedPatch is ignored.
Comment #5
sylvain lecoy commentedLet's submit again..
Comment #6
sylvain lecoy commentedComment #7
damien tournoud commentedDon't use a -D7 suffix. It's a weird syntax that causes a patch *not* to be tested :)
Comment #8
sylvain lecoy commentedHa thanks, anyway I think I missed something in the patch, the correct handling of images styles; here it just gives url to the original file, but the goal was to give url to a styled image.
Comment #9
sylvain lecoy commentedAttached a patch adding the feature for image field to display image url as plain text.
(Mainly useful for AMF or JSON serialization where you need a specific type of image but not the original URL).
Comment #10
sylvain lecoy commentedNeed review, and with the good patch extension this time.
Comment #12
sylvain lecoy commentedComment #14
sylvain lecoy commentedComment #16
sylvain lecoy commentedComment #18
sylvain lecoy commentedComment #20
sylvain lecoy commentedWhat the hell with that ?!
Comment #21
sylvain lecoy commentedTricking the Test Engine with a fake index...
Comment #22
sylvain lecoy commentedIn case of
Comment #24
sylvain lecoy commentedThis image.field.inc changed since 7.0 ?
I can't navigate through git repository neither clone it (i'm on 3G bandwidth with my phone and limits download to 8MB).
Comment #25
sylvain lecoy commentedLet's try this
Comment #26
sylvain lecoy commentedThe previous patch actually introduce a tab instead of a space, so use this one instead.
(If it passes obviously..)
Comment #27
sylvain lecoy commentedChanged component to image module.
Comment #28
sylvain lecoy commentedThis problem can be fixed more generally by: #1133984: Formatting fields values not only for html output.
Comment #29
kenorb commentedOriginal image:
<img src="http://localhost/properties/feed/sites/default/files/images/ShowImageXML.asp_173.jpeg" width="683" height="909" /></image>Generated plain text URL:
http://localhost/properties/feed/sites/default/files/styles//public/images/ShowImageXML.asp_173.jpeg?itok=YI8bqE07so it seems //public path hasn't been translated into proper URL.
It seems
image_style_path($display['settings']['image_style'], $item['uri']);returns"public://styles//public/images/ShowImageXML.asp_173.jpeg",$item['uri']="public://images/ShowImageXML.asp_173.jpeg".Comment #30
kenorb commentedI think suggestion from #1 is not so bad idea, so uploading patch against file.field.inc.
My use case is to print URLs of images for the XML output of view (#903528: Allow for XML fragments), so I need to get rid of the html, however I want to use my own XML tags in TPL, e.g.