Advertisement

How to convert jpg to snb

Started by November 20, 2015 04:57 PM
5 comments, last by aeroKittens 9 years, 1 month ago

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();
		}	
	}

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

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.
Advertisement

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

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

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.

Follow his advice, and try to do the following:

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.

Hello to all my stalkers.

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.

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.

Follow his advice, and try to do the following:

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.

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.


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 smile.png

I accidentally down-voted your post instead of voting it up.

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

Hello to all my stalkers.

Advertisement

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

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

This topic is closed to new replies.

Advertisement