|
Post by meshack on Jan 10, 2017 7:50:04 GMT
Good Day
I am having a problem with viewing images on rhosimulator,they are type blob image,It shows that the image is there,but it doesnt dispaly them.
Regards Meshack
|
|
|
Post by Super Admin on Jan 10, 2017 10:48:40 GMT
Hi,
What platform you test on, Windows or Mac OS? Please attach the code snippet.
Regards, Konstantin
|
|
|
Post by meshack on Jan 19, 2017 12:44:25 GMT
hi i am using windows
here are the actions in my controller
def choose_picture
$source_params = {:establishment_id => @params['establishment_id']}
@establishment = Establishment.find @params['establishment_id']
if @establishment Camera::choose_picture(url_for :action => :camera_callback) "" redirect :controller => :Establishment, :action => :list, :query => { :establishment_id => @establishment.object }
else object_not_found end end
def camera_callback @media = Media.create({:establishment_id => $source_params[:establishment_id], :file_contents => @params['file_contents']})
WebView.navigate( url_for :controller => :Establishment, :action => :list, :query => { :establishment_id => $source_params[:establishment_id] } ) "" end
And this is my index file where i display all the images
<div data-role="content"> <ul data-role="listview"> <% @media.each do |media| %> <label><%=media.establishment_id%></label> <a> <img src="<%=Rho::RhoApplication::expandDatabaseBlobFilePath(media.file_contents)%>" width='300px'/> </a>
<a href="<%=url_for(:action => :delete, :id =>media.object)%>">Delete</a>
<% end %> </ul> </div>
|
|
|
Post by Vladimir Musulainen on Jan 19, 2017 16:41:04 GMT
meshack Hi, Just for clarification, how you put images to the blob folder on rhosimulator? By hand?
|
|
|
Post by meshack on Jan 20, 2017 7:26:56 GMT
Hi,I have this link that triggers the action choose_picture from my controller,then it opens a directory/folder in my computer where i choose the image that i want.
<a href="<%= url_for :controller => :Media,:action => :choose_picture,:query => {:establishment_id => @establishment.object }%>" class="ui-btn ui-btn-raised clr-warning"> <i class='fa fa-camera'></i> choose picture</a>
regards Meshack
|
|
|
Post by Vladimir Musulainen on Jan 20, 2017 7:57:33 GMT
Ok, give me, pls, a couple of hours for reproducing of the issue
|
|
|
Post by Vladimir Musulainen on Jan 20, 2017 8:38:25 GMT
I tested. The image is shown nice. Tested on MacOS Sierra
In my erb:
<img src="<%= Rho::Application.expandDatabaseBlobFilePath(@item.pictureUri) %>">
Value of @item.pictureUri is "/db/db-files/id_012020171127412750.jpg"
The image is located at "<path to your project>/rhosimulator/db/db-files/id_012020171127412750.jpg"
|
|
|
Post by rachidi on Jan 26, 2017 9:51:55 GMT
Hi Vladimir,
I do trust you are well. I was able to reproduce the same issue even with the rhomobile rhodes-system-api-samples "camera" test application. You alluded to the fact that you are using a MacOS during your testing. Meshack and I are both using Windows OS (both Windows 10 and Windows 7) produce the same outcome. Is there perhaps an issue when rendering images in Windows OS. From the log obtained from my side, the value of @item.pictureUri is "db/db-files/Image_01-26-2017_09.34.17_-000.jpg" and Rho::Application.expandDatabaseBlobFilePath(@item.pictureUri) produces "C:/Users/Rachidi/Documents/SableAssetsProjectsMobile/ConditionalAssessmentMobileApplication/rhosimulator/db/db-files/Image_01-26-2017_09.34.17_-000.jpg". However, I still can't see the picture on the rhosimulator. All I can see is a question mark instead of the expected picture. I look forward to reading from you soon.
Kind Regards, Rachidi
|
|
|
Post by Super Admin on Jan 26, 2017 14:24:36 GMT
Hi Guys,
I'll check it on Windows and let you know later today.
Regards, Konstantin
|
|
|
Post by Super Admin on Jan 26, 2017 21:21:17 GMT
Hi,
Seems there is a bug. On Windows absolute path doesn't work. So pls use relative path that comes into callback. See example below.
<img src="<%= @item.pictureUri %>" />
Regards, Konstantin
|
|
|
Post by rachidi on Jan 27, 2017 6:45:32 GMT
Hi Konstantin,
Thank you so much for your feedback. I did implement your suggestion. However, I ended up with the same result. Basically, passing the relative path as source argument to img tag resulted in: <img src="db/db-files/Image_01-27-2017_06.27.07_-000.jpg"/>. Any other suggestions? I am using RhoStudio version 5.5.0 on a Windows 10 machine.
Kind Regards, Rachidi
|
|
|
Post by Super Admin on Jan 27, 2017 8:26:13 GMT
Hi Rachidi, Please register at tautechnologies.zendesk.com and file a ticket. Please also attach your rhodes app's source code to that ticket. Regards, Konstantin
|
|
|
Post by rachidi on Jan 27, 2017 9:35:47 GMT
Hi Konstantin,
Ticket has been created and rhodes app's source code has been attached. The ticket number is: Request #432. Looking forward to your feedback.
Kind Regards, Rachidi
|
|
|
Post by Super Admin on Jan 27, 2017 9:53:30 GMT
Okay. Thanks.
Regards, Konstantin
|
|
|
Post by Super Admin on Feb 9, 2017 8:33:36 GMT
Hi,
Please use workaround like below
<img src="/rhosimulator/<%=@item.pictureUri%>" />
Regards, Konstantin
|
|