This one's best described with a a graphic: See attached file.

Clicking the "Sample original image" or "View actual size" text displays the image (at full size).

Version affected: 7.0-beta1. Brand-new image style.

Good luck!

Comments

haza’s picture

Confirmed on D7 HEAD

Seems the url generated for the image is something like
http://exemple.com/modules/image/sample.png%3F1286633141

Shouldn't we have something like http://exemple.com/modules/image/sample.png?1286633141 here ? (the "?" is encoded)

haza’s picture

Status: Active » Needs review
StatusFileSize
new1.25 KB

Here is a little patch that process the image path through url() function, correcting the issue

Status: Needs review » Needs work

The last submitted patch, d7.936246.patch, failed testing.

haza’s picture

Status: Needs work » Needs review
StatusFileSize
new1.24 KB

non-applicable patch, maybe this one is better ?

swentel’s picture

Status: Needs review » Needs work

While the patch fixes the issue, it's better to use file_create_url() instead of url() for creating links to files/images.

swentel’s picture

While we're at it, let's change time() to REQUEST_TIME too.

haza’s picture

Status: Needs work » Needs review
StatusFileSize
new2.45 KB

Yes, you're right.
Change the url() to file_create_url() and use REQUEST_TIME instead of time()

webchick’s picture

Priority: Normal » Major
Issue tags: +Needs tests

And also while we're at it, we need some tests for this.

I think (hope) we already have tests for image styles, so this will just be an assertion that the image shows up on the page.

If that turns out to not be possible, then ok, but we should at least try it because this is a pretty nasty, obvious problem. Promoting to "Major".

swentel’s picture

StatusFileSize
new4.1 KB

Added test, not sure if this is really the way togo, but it's something :)

ygerasimov’s picture

The test doesn't catch this bug. I have tried to run the test without applying changes to image.admin.inc

swentel’s picture

Hmm, it does here, not sure what might be wrong.

ygerasimov’s picture

what I have done is:
1. CVS checkout of HEAD
2. Cleaned patch. Leaved only changes to image.test file.
3. Applied patch and ran all the tests on image module

I didn't received any errors that is bad as I didn't fixed the original issue (didn't applied that patch).

Patch is working properly. Image gets displayed. What I think is it is not possible to write a test for this case. Or at least I have no idea how to test it.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

I'm not sure how to do that test either. But lets fix the bug or get more input.

ygerasimov’s picture

If the test is not valid please remove it from patch and lets get it committed.

dries’s picture

+++ modules/image/image.test	9 Oct 2010 23:43:56 -0000
@@ -381,6 +381,11 @@ class ImageAdminStylesUnitTest extends I
+    // Assert the sample image URL is build like this: http://host/path_to_image_module/sample.png

Needs to wrap at 80 character boundary. Would also be nice to state why it should have that format.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
haza’s picture

It seems that the original issue was fixed in #563382: when editing image style, link to sample image broken (missing file_create_url()), or am I wrong. (at least, i'm not able to reproduce the bug with a fresh install)

Btw, we still need tests for that.

webchick’s picture

Title: "Sample original image" not displaying » Tests for "Sample original image" not displaying
Priority: Major » Normal

Ok, let's repurpose this issue.

Tor Arne Thune’s picture

Version: 7.x-dev » 8.x-dev
Category: bug » task
Issue tags: +Needs backport to D7
claudiu.cristea’s picture

Status: Needs work » Closed (duplicate)

Duplicate of #563382: when editing image style, link to sample image broken (missing file_create_url()) and was fixed, I cannot reproduce it anymore in D8.