Results 1 to 14 of 14
  1.    #1  
    Hello everyone,

    I am a newbee to WebOS. I am developing a code to capture an image with camera and resize it by some means, so it is shown in an ImageView on my current scene.
    Can anyone guide me how to achieve this?

    Thanks in advance.
  2. xybyre's Avatar
    Posts
    42 Posts
    Global Posts
    45 Global Posts
    #2  
    There is a service called extractfs, which you can use to resize images. It's undocumented, but you can use a special filename to call the service.

    For example, use this as the image filename:
    "/var/luna/data/extractfs" + your_file_name + ":0:0:58:58:3";

    where 58:58 is the x:y dimensions you want to resize to.

    I know it's not the same as actually resizing the image, but it's the only option I've found. Using a full-size camera image causes too big of a performance hit otherwise.
  3.    #3  
    I dont know if I am doing it correct or not. I tried using as

    var imagefile = "/var/luna/data/extractfs" + "images/forest.jpg" + "0:0:58:58:3";
    this.controller.get('myPhotoDiv').mojo.centerUrlProvided(imagefile);

    But it displays nothing.
    I want to show a single image, so using img tag will also work. But I dont know how?

    Please post some code snippet if possible, as I am new to javascript.
  4. xybyre's Avatar
    Posts
    42 Posts
    Global Posts
    45 Global Posts
    #4  
    Oh, I forgot to mention that the filename has to be the full path. For example:

    var imagefile = "/var/luna/data/extractfs" + "/media/internal/images/forest.jpg" + "0:0:58:58:3";
  5. #5  
    And I think you need a colon to start the numbers sequence at the end. Otherwise the string concatenation becomes forest.jpg0:...
    Your Pre wants Word Whirl from the App Catalog.

    It told me.
  6. xybyre's Avatar
    Posts
    42 Posts
    Global Posts
    45 Global Posts
    #6  
    Quote Originally Posted by sacherjj View Post
    And I think you need a colon to start the numbers sequence at the end. Otherwise the string concatenation becomes forest.jpg0:...
    Good catch
  7.    #7  
    hi xybyre,

    Thanks a ton, it works now.

    But as you said, it is undocumented, so will it create any problem like rejection of the application for app store? As use of undocumented features will not be allowed.
  8. xybyre's Avatar
    Posts
    42 Posts
    Global Posts
    45 Global Posts
    #8  
    Quote Originally Posted by amolitrivedi View Post
    But as you said, it is undocumented, so will it create any problem like rejection of the application for app store? As use of undocumented features will not be allowed.
    Unfortunately, I think you are right. I hope this gets added as a documented feature soon. In the meantime, you can submit your app as Preware...
  9. #9  
    Yes, please include your app in Preware.
  10. #10  
    I can't seem to get extractfs to work for local resources.

    var imagefile = "/var/luna/data/extractfs" + "/media/internal/images/forest.jpg" + "0:0:58:58:3";
    this.controller.get('myPhotoDiv').mojo.centerUrlProvided(imagefile);

    fails with the error: Not allowed to load local resource: file:///var/luna/data/extractfs/media/internal/images/forest.jpg:0:0:58:58:3

    On the other hand
    var imagefile = "/var/luna/data/extractfs" + remote_url + "0:0:58:58:3";
    this.controller.get('myPhotoDiv').mojo.centerUrlProvided(imagefile);

    works as advertised. Ideas?
  11. #11  
    bug in 1.3.1

    Known problem
  12. xybyre's Avatar
    Posts
    42 Posts
    Global Posts
    45 Global Posts
    #12  
    Quote Originally Posted by cdaniel9 View Post
    I can't seem to get extractfs to work for local resources.

    var imagefile = "/var/luna/data/extractfs" + "/media/internal/images/forest.jpg" + "0:0:58:58:3";
    this.controller.get('myPhotoDiv').mojo.centerUrlProvided(imagefile);

    fails with the error: Not allowed to load local resource: file:///var/luna/data/extractfs/media/internal/images/forest.jpg:0:0:58:58:3
    This is something Palm "fixed" with their 1.3.1 update. extractfs was working fine with 1.2.x.

    Of course it still works for Palm apps... If you change your app's id to com.palm.whatever, you will see that extractfs will start working for local files again. I guess they are cutting off undocumented features.

    They _really_ need to make this public! Performance is unacceptable if you try to use even one full-size camera image (resized to thumbnail dimensions, of course) in your scene, let alone a whole list.
  13. tc600's Avatar
    Posts
    305 Posts
    Global Posts
    306 Global Posts
    #13  
    Anyone have a tip on how to use this with an external url? I can get it to work fine with local resources, but I'm trying to get it to resize on-the-fly an image from the web:

    /var/luna/data/extractfs/http://a.b.com/images/p.jpg:0:0:60:60:3

    Anyone know what the string should look like instead?
  14. #14  
    Quote Originally Posted by sacherjj View Post
    And I think you need a colon to start the numbers sequence at the end. Otherwise the string concatenation becomes forest.jpg0:...
    I see the problem but I cant see the solution ???

Posting Permissions