~ubuntu-branches/ubuntu/wily/tupi/wily-proposed

« back to all changes in this revision

Viewing changes to src/plugins/export/genericexportplugin/genericexportplugin.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-06-23 12:48:05 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130623124805-9xq9kggclxvli7r9
Tags: 0.2+git02-1
* New upstream release [June 2013].
  + ready for "libav9" transition.
* Build-Depends:
  + libquazip-dev
* Packaging updates:
  + added ugly override for broken upstream libav detection;
    "pkg-config" is added to Build-Depends for that matter.
  + rules simplified as upstream introduced support for $(DESTDIR).
  + re-build translations after configure.
  + re-build/re-compress man page.
  + dropped all patches.
  + updated lintian-overrides, new overrides for
    "library-not-linked-against-libc" in private libs.
  + ship all icons and docs in -data package.
  + data de-duplication in -data package.
  + debian/watch to check for tags at github as well.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
        dir.mkdir(dir.path());
73
73
 
74
74
    m_baseName = fileInfo.baseName();
75
 
    const char *extension = "PNG";
76
 
 
 
75
    const char *extension = "";
 
76
    QImage::Format imageFormat;
77
77
    switch (format) {
78
78
            case TupExportInterface::JPEG:
79
79
                 extension = "JPEG";
 
80
                 imageFormat = QImage::Format_RGB32;
 
81
                 break;
 
82
            case TupExportInterface::PNG:
 
83
                 extension = "PNG";
 
84
                 imageFormat = QImage::Format_ARGB32;
80
85
                 break;
81
86
            case TupExportInterface::XPM:
82
87
                 extension = "XPM";
 
88
                 imageFormat = QImage::Format_RGB32;
83
89
                 break;
84
90
            default:
85
91
                 break;
92
98
 
93
99
             int photogram = 0;
94
100
             while (renderer.nextPhotogram()) {
95
 
                    QImage image(size, QImage::Format_RGB32);
 
101
                    QImage image(size, imageFormat);
96
102
                    {
97
103
                     QPainter painter(&image);
98
104
                     painter.setRenderHint(QPainter::Antialiasing, true);
123
129
{
124
130
    QString path = filePath;
125
131
    const char *extension;
 
132
    QImage::Format imageFormat;
 
133
    QColor bgColor = color;
126
134
 
127
135
    if (filePath.endsWith(".PNG", Qt::CaseInsensitive)) {
128
136
        extension = "PNG";
 
137
        imageFormat = QImage::Format_ARGB32;
 
138
        bgColor.setAlpha(0);
129
139
    } else if (filePath.endsWith(".JPG", Qt::CaseInsensitive) || filePath.endsWith("JPEG", Qt::CaseInsensitive)) {
130
140
               extension = "JPG";
 
141
               imageFormat = QImage::Format_RGB32;
131
142
    } else {
132
143
        extension = "PNG"; 
133
 
        path += ".png";  
 
144
        path += ".png";
 
145
        imageFormat = QImage::Format_ARGB32;
134
146
    }
135
147
 
136
 
    TupAnimationRenderer renderer(color);
 
148
    TupAnimationRenderer renderer(bgColor);
137
149
    renderer.setScene(scene, size);
138
150
 
139
151
    renderer.renderPhotogram(frameIndex);
140
 
    QImage image(size, QImage::Format_RGB32);
 
152
    QImage image(size, imageFormat);
141
153
 
142
154
    {
143
155
        QPainter painter(&image);