Skip to content

Commit 8fb952a

Browse files
committed
Merge pull request sakaiproject#1309 from jonespm/SAK-29622
SAK-29622 - Pictures not showing after uploading with Profile tool (g…
2 parents 1a96e7f + 7b2ef98 commit 8fb952a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

profile2/tool/src/java/org/sakaiproject/profile2/tool/components/GalleryImageRenderer.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.apache.wicket.markup.html.image.resource.BufferedDynamicImageResource;
2121
import org.apache.wicket.markup.html.panel.Panel;
2222
import org.apache.wicket.model.Model;
23+
import org.apache.wicket.request.resource.IResource;
2324
import org.apache.wicket.spring.injection.annot.SpringBean;
2425
import org.sakaiproject.profile2.logic.SakaiProxy;
2526
import org.sakaiproject.profile2.util.ProfileConstants;
@@ -57,8 +58,8 @@ else if (sakaiProxy.getResource(imageResourceId) == null) {
5758
BufferedDynamicImageResource imageResource = new BufferedDynamicImageResource() {
5859

5960
private static final long serialVersionUID = 1L;
60-
61-
protected byte[] getImageData() {
61+
@Override
62+
protected byte[] getImageData(IResource.Attributes ignored) {
6263
return imageBytes;
6364
}
6465
};

profile2/tool/src/java/org/sakaiproject/profile2/tool/components/ProfileImage.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.apache.wicket.markup.html.WebComponent;
55
import org.apache.wicket.model.IModel;
66
import org.sakaiproject.profile2.util.ProfileConstants;
7+
import java.util.concurrent.TimeUnit;
78

89
/**
910
* Renders a user's profile image via the direct entity URL.
@@ -57,7 +58,8 @@ protected void onComponentTag(ComponentTag tag) {
5758
}
5859
}
5960

60-
String url = "/direct/profile/"+userUuid + "/image" + sizePart;
61+
//Cache for a minute
62+
String url = "/direct/profile/"+userUuid + "/image" + sizePart + "?t=" + TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis());
6163

6264
tag.put("src", url);
6365
}

0 commit comments

Comments
 (0)