Public Group

# How to convert jpg to snb

This topic is 1038 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Is there any library/code (compatible with java) available to convert a .jpg file format to .snb (S memo) format? (not the reverse direction)

I normally use this for  compressed file ->bitmap->file compressed, but it hasn't got .snb

	 void save_bm_image( Bitmap gBitmap, String bname, String fname  ){

File file = new File (bname, fname);
if (file.exists ()) file.delete ();
try {
FileOutputStream out = new FileOutputStream(file);
gBitmap.compress(Bitmap.CompressFormat.PNG, 90, out);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}



##### Share on other sites
According to this android thread, an SNB is just a zip archive. If there isn't any other metadata required, stuff your jpg in a zip (no compression, 'cause jpg already lossy compressed) and save the zip with an snb extension.

##### Share on other sites

No.  The thread you referred to discussed how to open .snb on pc which is never the problem since you can export to jpg...  I want to convert the other way - from jpg to snb

##### Share on other sites

No.  The thread you referred to discussed how to open .snb on pc which is never the problem since you can export to jpg...  I want to convert the other way - from jpg to snb

Based on his link, I agree with fastcall. While that is what they're discussing, the solution says that renaming the .snb to .zip will allow it to be opened -- thus it's a logical step to assume the reverse is also true.

1. Compress your .jpg file to .zip (e.g. using WinZip, WinRar, or whatever people use these days). If you can choose compression ratio, choose "None" or "Storage" or similar.

2. Rename your new .zip file to .snb.

EDIT: I accidentally a word.

Edited by Lactose!

##### Share on other sites

While any SNB file is a valid ZIP file, not every valid ZIP file is a valid SNB file. Consider that every JAR file is also a valid ZIP file - but you cannot just rename a JAR file to SNB and expect it to do anything useful in a Samsung Note smartphone. The links you have provided explain how to dig out useful media from an SNB file, but offer next to no help towards building a working SNB file from pre-existing media. Which is what the OP is trying to accomplish.

True, and good points

Could someone vote it up to balance it out, please?

Edited by Lactose!

##### Share on other sites

thanks fastcall22, Lactose!

and monophotonic

While any SNB file is a valid ZIP file, not every valid ZIP file is a valid SNB file. Consider that every JAR file is also a valid ZIP file - but you cannot just rename a JAR file to SNB and expect it to do anything useful in a Samsung Note smartphone. The links you have provided explain how to dig out useful media from an SNB file, but offer next to no help towards building a working SNB file from pre-existing media. Which is what the OP is trying to accomplish.

My advice to alwaysGrey is to make some SNB files with the kind of content you want your created files to have, and look into how the JPGs are stored in those. Then try to recreate that with your own code and check how well it works. When there are errors, create some more files with small differences around the erroneous bits and see how those change the resulting file.

great! thanks again, I will try this. Looks feasible though a bit less straight forward than i'd imagined

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
13
5. 5

• 14
• 10
• 23
• 9
• 57
• ### Forum Statistics

• Total Topics
632639
• Total Posts
3007605
• ### Who's Online (See full list)

There are no registered users currently online

×