Provide the user with feedback about export filter capabilities
Closed, ResolvedPublic

Description

See https://bugs.kde.org/show_bug.cgi?id=342141

class ExportConverter {
}

class MergeDown : public ExportConverter {
}

class ConvertToRgb : public ExportConverter {
}

list (id, Covnerter)

class ImportExportCheck {

enum Level  {
    block,  // COnversion is needed, otherwise we cannot save
    warn, // We will save this, but the result might be degraded
    go // We fully support this, yay
}

ImportExportCheck(Level level, customWarning) 

Level check();

QString warning();

bool convert();

}

class RgbU8Check : public ImportExportCheck
{

check() {
    image->colorSpace9) == RGBU8
}

convert() {
    return converterId;
}

}

// Means: we can save multiple layers
class SingleLayerCheck : public ImpexCheck {

check() {
    return image->layercount == 1
}

convert() {
    // merge down to one layer or just get the projection and replace layerstack
}

warning() {

    File format X does not support multiple layers, your image will be merged down, and make sure you also save as KRA because if you ond't you're effed.
}

}

class LayerStyleCheck : public ImpexCheck {

convert() {
    if (filtercaps.contains(singlelayercheck && singlelayercheck = go)
        ask: merge down, skip styles or save layers & merged imafge as a new layer
    }
}

}

conversion checker

list of checks
    - singlelayercheck GO
    - RgbU8Check WARN
    if (check == BLOCK) {
        converters << check->converter
    }
    - LayerStyleCheck -> not in document, skip
    ...

converters.sort(priority) // unique set
foreach(converter) convert;

// check blockers
all checks that are not in the capabilities
    check whether those are used
all warnings in the capabilities
    check whether those are used

if warnings, the image is not marked as saved, it's still dirty

impexfilter

list<checks> capabilities() {
        list<checks> list;
        list << check(warn, "message")
        list << check(go)

}



Export To PNG

PNG does not support the following feature you are using in your image:
    * Multiple Layers
    * 32 bit floating point
    * LAB
    * Layer Styles
    * Filter Layers
    * And the kitchen sink
Krita will convert your image before export to PNG:
    * Flatten
    * Convert to RGB
If you don't want to lose your image, also save as KRA
 
Save, Cancel
rempt created this task.Aug 26 2016, 9:00 AM
rempt added a comment.EditedSep 29 2016, 11:59 AM

Possible list of checks:

  • colormodel
  • channel depth
  • description
  • profile
  • x resolution
  • y resolution
  • background color
  • compositions
  • assistants
  • grid
  • guides
  • animation
  • exif
  • image icc profile
  • image proofing configuration
  • psd layer styles
  • multiple layers
  • group layers
  • vector layers
  • file layers
  • paint layers
  • adjustment layers
  • generator layers
  • clone layers
  • filter masks
  • transform masks
  • transparency masks
  • selection masks
  • colorize masks
rempt added a comment.Sep 30 2016, 9:34 AM

Grids, guides and assistants cannot be checked in this way because they are part of the KisDocument, not KisImage.

There is always a softproofing configuration present, so the check doesn't make sense.

This is now implemented. The conversion system part didn't make sense because the filters themselves all need to be able to handle a full KisImage, then can be used outside of the KisImportExportManager, and besides, each filter has its own idiosyncratic way of handling filters. The warning is now now shown with an icon and a popup button that when clicked shows the whole list of reasons.

rempt updated the task description. (Show Details)Oct 1 2016, 9:26 AM
rempt closed this task as Resolved.Oct 3 2016, 8:26 AM