From 85babd8de0a6050f6cd65811c92dc635f548f139 Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Fri, 8 Aug 2008 12:39:24 +0000 Subject: [PATCH] minor fix to content adaptation module --- mbuni/ChangeLog | 3 +++ mbuni/extras/pgsql-queue/Makefile.am | 1 + mbuni/mmlib/mms_uaprof.c | 17 ++++++++++------- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/mbuni/ChangeLog b/mbuni/ChangeLog index 9611523..5d2d87d 100644 --- a/mbuni/ChangeLog +++ b/mbuni/ChangeLog @@ -1,3 +1,6 @@ +2008-08-08 P. A. Bagyenda + * Fix to content adaptation: Better handling of supported image types + thanks to George Barros 2008-08-06 P. A. Bagyenda * Additional fixes for bad message formats causing crash * Fix for incorrect From and To headers in DLR and RR messages diff --git a/mbuni/extras/pgsql-queue/Makefile.am b/mbuni/extras/pgsql-queue/Makefile.am index 458db80..9851071 100644 --- a/mbuni/extras/pgsql-queue/Makefile.am +++ b/mbuni/extras/pgsql-queue/Makefile.am @@ -1,3 +1,4 @@ +EXTRA_DIST = tables.sql lib_LTLIBRARIES = libmms_pgsql_queue.la libmms_pgsql_queue_la_SOURCES = mms_pgsql_queue.c libmms_pgsql_queue_la_LDFLAGS = -module diff --git a/mbuni/mmlib/mms_uaprof.c b/mbuni/mmlib/mms_uaprof.c index c6978ba..f110e49 100644 --- a/mbuni/mmlib/mms_uaprof.c +++ b/mbuni/mmlib/mms_uaprof.c @@ -928,13 +928,16 @@ static int modify_msg(MIMEEntity *msg, MmsUaProfile *prof) selector = "-[0]"; else selector = "-"; - /* We have an unsupported image now. time to convert it. */ + /* We have an unsupported image now, or a supported one that must be scaled. + * time to convert it. + */ if (icmd) { - cmd = octstr_format("%S | " IMGCONVERTCMD, - icmd, cformats[iindex].file_ext, selector, - cformats[oindex].file_ext, tmpf); + cmd = (supported) ? octstr_format("%S > %s", icmd, tmpf) : + octstr_format("%S | " IMGCONVERTCMD, + icmd, cformats[iindex].file_ext, selector, + cformats[oindex].file_ext, tmpf); octstr_destroy(icmd); - } else + } else /* Image format MUST be unsupported */ cmd = octstr_format("cat %s | " IMGCONVERTCMD, tmpf2, cformats[iindex].file_ext, selector, cformats[oindex].file_ext, tmpf); @@ -964,8 +967,8 @@ static int modify_msg(MIMEEntity *msg, MmsUaProfile *prof) if ((s = octstr_read_file(tmpf)) != NULL) { replace_body(msg, s, params_h, - cformats[oindex].content_type, - cformats[oindex].file_ext,0); + supported == 1 ? cformats[iindex].content_type : cformats[oindex].content_type, + supported == 1 ? cformats[iindex].file_ext : cformats[oindex].file_ext,0); octstr_destroy(s); supported = 1; goto done2; /* we are done, don't even change headers. */