[haiku-development] Re: [haiku-commits] Re: r40298 - in haiku/trunk/src/add-ons/translators: bmp ico jpeg

  • From: Siarzhuk Zharski <zharik@xxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Fri, 28 Jan 2011 11:54:02 +0200

Hi All,

On Thu, 27 Jan 2011 11:01:12 +0200, Siarzhuk Zharski wrote in [haiku-commits]:
By the way, the correct MIME signature is required to be in the Data
Translation binary resources to let that localization work. At the
moment system doesn't load corresponding catalog with syslog message
about lack of MIME type in the binary resource. Manual adding correct
MIME signature solves the problem. Following patch fixes the problem
in my case, but there are some remarks in FileTypes Add-On for
example, that "this is add-on but application, so it have no app
signature". Another remark above "AddResource" clause that "TODO:
Doesn't seem to work." Are there any problems possible?


Index: Jamfile
===================================================================
--- Jamfile     (revision 40293)
+++ Jamfile     (working copy)
@@ -5,6 +5,8 @@
 UseLibraryHeaders png zlib ;
 SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;

+AddResources PNGTranslator : PNGTranslator.rdef ;
+
 if $(HAIKU_GCC_VERSION[1]) = 2 {
        SubDirCcFlags -DPNG_NO_PEDANTIC_WARNINGS ;
 }

Index: PNGTranslator.rdef
===================================================================
--- PNGTranslator.rdef  (revision 0)
+++ PNGTranslator.rdef  (revision 0)
@@ -0,0 +1 @@
+resource app_signature "application/x-vnd.Haiku-PNGTranslator";

I forward this thread in development list to assure that there are no objections to such way of fixing localization problem in data translator add-ons.

The Problem: regardless of existing catalogs for data translation add-ons they are not use locale resources. There are messages in the syslog:

USER 'liblocale.so'[210]: File /boot/system/add-ons/Translators/EXRTranslator has no mimesignature, so it can't use localization. USER 'liblocale.so'[210]: File /boot/system/add-ons/Translators/HVIFTranslator has no mimesignature, so it can't use localization. USER 'liblocale.so'[210]: File /boot/system/add-ons/Translators/PCXTranslator has no mimesignature, so it can't use localization. USER 'liblocale.so'[210]: File /boot/system/add-ons/Translators/PNGTranslator has no mimesignature, so it can't use localization.

The Solution: add mimesignature into corresponding binary resource. See the sample patch above.

The Question #1: There are some warning remarks in the Jamfile of FileTypes Tracker Add-on about mimesignatures for non-application binaries and for using JAM target "AddResource". Are those warnings (http://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/tracker/filetype/Jamfile#L5 and http://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/tracker/filetype/FileType.rdef#L5) still actual?

The Question #2: Typical resource definition file contains both the file version data and icon. Should such info provided for the data translation add-ons too?

Thank you.

--
Kind Regards,
   S.Zharski

Other related posts: