1
0
Fork 0

minor fix to content adaptation module

This commit is contained in:
bagyenda 2008-08-08 12:39:24 +00:00
parent 3f4df1cdc7
commit 85babd8de0
3 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,6 @@
2008-08-08 P. A. Bagyenda <bagyenda@dsmagic.com>
* Fix to content adaptation: Better handling of supported image types
thanks to George Barros <gbarros@ipcomsa.com>
2008-08-06 P. A. Bagyenda <bagyenda@dsmagic.com>
* Additional fixes for bad message formats causing crash
* Fix for incorrect From and To headers in DLR and RR messages

View File

@ -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

View File

@ -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. */