webOS Nation Forums >  webOS apps and software >  webOS development > Does anyone know where the browser images are stored?
Does anyone know where the browser images are stored?

  Reply
 
LinkBack Thread Tools Display Modes
Old 07/22/2009, 03:41 PM   #1 (permalink)
Member
 
sarah peterman's Avatar
 
Join Date: Jun 2009
Location: York, PA
Posts: 259
Likes Received: 0
Thanks: 32
Thanked 141 Times in 55 Posts
Default Does anyone know where the browser images are stored?

In the browser you have the ability to bookmark a web page or add the page to the launcher. When you choose to add the page to the launcher, you can select any part of the web page and make it the icon. Has anyone found where these icons are kept? I've already looked through the browsers images folder, but it's not kept there. Any help would be appreciated, thanks.
sarah peterman is offline   Reply With Quote
Thanked By: czarphanguye
Old 07/22/2009, 06:07 PM   #2 (permalink)
Member
 
Join Date: Jul 2009
Posts: 16
Likes Received: 0
Thanks: 3
Thanked 2 Times in 2 Posts
Default

Try checking the sqlite database(s) associated with the browser; it's probably stored as a binary data column in the table which contains bookmarks.
brianfeldman is offline   Reply With Quote
Old 07/22/2009, 07:56 PM   #3 (permalink)
Member
 
Join Date: Jun 2009
Posts: 17
Likes Received: 0
Thanks: 9
Thanked 3 Times in 1 Post
Default

The images are in /var/luna/data/browser/icons . For the "built-in" bookmarks, there are 3 files each:
  • bookmark-icon-{name}.png - 32x32 px icon you see in the bookmark list
  • {name}-bookmark-icon.png - 64x64 px icon that doesn't seem to appear anywhere
  • {name}-bookmark-thumbnail.png - 90x120 px thumbnail that appears when you start the browser

I'm not happy with the way the Pre tries to make images for you, so I created some of my own. (I also use a better naming convention for the files).

To add your own images:

1. Copy the default bookmark images from /var/luna/data/browser/images to you PC (use WinSCP or copy them to /media/internal and then use the USB cable). They make good templates for creating new images.

2. Create some new images. Here are mine for m.cnn.com:


(cnn-icon32.png)


(cnn-icon64.png)


(cnn-thumbnail.png)

3. Copy the images to your Pre under /var/luna/data/browser/images .

4. Become root and make your filesystem read-write:

Code:
$ sudo -i

# rootfs_open -w
5. Open the bookmark database with the sqlite utility:

Code:
# /usr/bin/sqlite3 /var/palm/data/file_.usr.palm.applications.com.palm.app.browser_0/0000000000000004.db
6. Add a bookmark, save, and exit sqlite:

Code:
sqlite> begin transaction;

sqlite> insert into bookmarks (url,title,defaultEntry,iconFile32,iconFile64,thumbnailFile)
 values ('http://m.cnn.com','CNN',1,'/var/luna/data/browser/icons/cnn-icon32.png','/var/luna/data/browser/icons/cnn-icon64.png','/var/luna/data/browser/icons/cnn-thumbnail.png');

sqlite> commit;

sqlite> .exit
Note: the bookmarks are keyed on title, so if you already have a bookmark titled "CNN", the above code will simply update the existing bookmark.


To view all you bookmarks in the database:

Code:
sqlite> .header on

sqlite> select * from bookmarks;
Columns:
  • id - numeric ID
  • url - URL
  • title - Title
  • date - numeric representing the date-time the bookmark was added
  • parent - ?
  • idx - numeric controlling sort order of the bookmarks (when two or more bookmarks have the same idx value, the browser sorts on title)
  • defaultEntry - numeric: 0 for bookmarks you add through the browser, 1 for "built-in" bookmarks (Pre won't mess with the images)
  • iconFile32 - path to the 32x32 px icon
  • iconFile64 - path to the 64x64 px icon
  • visitCount - number of times you selected the bookmark
  • thumbnameFile - path to the thumnail
  • lastVisited - numeric representing the date-time last time you selected the bookmark
  • startIdx - ?
dbgod is offline   Reply With Quote
Old 07/22/2009, 08:31 PM   #4 (permalink)
Member
 
sarah peterman's Avatar
 
Join Date: Jun 2009
Location: York, PA
Posts: 259
Likes Received: 0
Thanks: 32
Thanked 141 Times in 55 Posts
Default

Quote:
Originally Posted by dbgod View Post
The images are in /var/luna/data/browser/icons . For the "built-in" bookmarks, there are 3 files each:
  • bookmark-icon-{name}.png - 32x32 px icon you see in the bookmark list
  • {name}-bookmark-icon.png - 64x64 px icon that doesn't seem to appear anywhere
  • {name}-bookmark-thumbnail.png - 90x120 px thumbnail that appears when you start the browser

I'm not happy with the way the Pre tries to make images for you, so I created some of my own. (I also use a better naming convention for the files).

To add your own images:

1. Copy the default bookmark images from /var/luna/data/browser/images to you PC (use WinSCP or copy them to /media/internal and then use the USB cable). They make good templates for creating new images.

2. Create some new images. Here are mine for m.cnn.com:


(cnn-icon32.png)


(cnn-icon64.png)


(cnn-thumbnail.png)

3. Copy the images to your Pre under /var/luna/data/browser/images .

4. Become root and make your filesystem read-write:

Code:
$ sudo -i

# rootfs_open -w
5. Open the bookmark database with the sqlite utility:

Code:
# /usr/bin/sqlite3 /var/palm/data/file_.usr.palm.applications.com.palm.app.browser_0/0000000000000004.db
6. Add a bookmark, save, and exit sqlite:

Code:
sqlite> begin transaction;

sqlite> insert into bookmarks (url,title,defaultEntry,iconFile32,iconFile64,thumbnailFile)
 values ('http://m.cnn.com','CNN',1,'/var/luna/data/browser/icons/cnn-icon32.png','/var/luna/data/browser/icons/cnn-icon64.png','/var/luna/data/browser/icons/cnn-thumbnail.png');

sqlite> commit;

sqlite> .exit
Note: the bookmarks are keyed on title, so if you already have a bookmark titled "CNN", the above code will simply update the existing bookmark.


To view all you bookmarks in the database:

Code:
sqlite> .header on

sqlite> select * from bookmarks;
Columns:
  • id - numeric ID
  • url - URL
  • title - Title
  • date - numeric representing the date-time the bookmark was added
  • parent - ?
  • idx - numeric controlling sort order of the bookmarks (when two or more bookmarks have the same idx value, the browser sorts on title)
  • defaultEntry - numeric: 0 for bookmarks you add through the browser, 1 for "built-in" bookmarks (Pre won't mess with the images)
  • iconFile32 - path to the 32x32 px icon
  • iconFile64 - path to the 64x64 px icon
  • visitCount - number of times you selected the bookmark
  • thumbnameFile - path to the thumnail
  • lastVisited - numeric representing the date-time last time you selected the bookmark
  • startIdx - ?
Wow, fantastic. Thank you!
sarah peterman is offline   Reply With Quote
Old 08/08/2009, 11:30 PM   #5 (permalink)
Member
 
RickNeff's Avatar
 
Join Date: Jul 2009
Posts: 340
Likes Received: 4
Thanks: 119
Thanked 133 Times in 74 Posts
Default

Quote:
{name}-bookmark-icon.png - 64x64 px icon that doesn't seem to appear anywhere
Isn't this used as the icon if it's placed on the launcher?
RickNeff is offline   Reply With Quote
Old 08/09/2009, 05:28 AM   #6 (permalink)
Member
 
sarah peterman's Avatar
 
Join Date: Jun 2009
Location: York, PA
Posts: 259
Likes Received: 0
Thanks: 32
Thanked 141 Times in 55 Posts
Default

Quote:
Originally Posted by RickNeff View Post
Isn't this used as the icon if it's placed on the launcher?

Yeah, that's the icon used.
__________________
aka lunareclipse
You can find me here:
Twitter
Pre Themes
sarah peterman is offline   Reply With Quote
Old 08/09/2009, 04:54 PM   #7 (permalink)
Member
 
RickNeff's Avatar
 
Join Date: Jul 2009
Posts: 340
Likes Received: 4
Thanks: 119
Thanked 133 Times in 74 Posts
Default

Quote:
/var/luna/data/browser/images
It would appear on mine, after the 1.1 update, that it's now: /var/luna/data/browser/icons

I was hoping that simply replacing the files using the same names would update the icons, but you do apparently have to insert into the database. Also, since there are old icons from deleted bookmarks, I'm thinking it might be safe to delete the icons once they're added to the database. (In case one starts to run out of space.) Something I'll be trying actually.

Again, thanks so much for doing this research!
RickNeff is offline   Reply With Quote
Old 05/07/2010, 03:04 PM   #8 (permalink)
Member
 
Join Date: May 2010
Posts: 1
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Question

This posting seems to address what I'm looking for, but I might be a bit over my head. You indicate that the current graphic files are stored in /var/luna/data/browser/images. I cannot find that folder, nor do I see the internal/media folder where you are suggesting that they be copied to.

Also, I not familiar with the "sqlite utility". And I'm guessing that making myself "the root" has nothing to do with potting soil. ;-)

After that, I think I understand what you are recommending: 1) Move the existing images to the PC, 2) develop the better replacement images I want, and then move the new images back to the PRE to in place or the original ones.
JohnMcTighe is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0