MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / writePreviewFile

Method writePreviewFile

app/actions.cpp:930–946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

928} // Extract::writeIccProfile
929
930void Extract::writePreviewFile(const Exiv2::PreviewImage& pvImg, size_t num) const {
931 std::string pvFile = newFilePath(path_, "-preview") + std::to_string(num);
932 std::string pvPath = pvFile + pvImg.extension();
933 if (dontOverwrite(pvPath))
934 return;
935 if (Params::instance().verbose_) {
936 std::cout << _("Writing preview") << " " << num << " (" << pvImg.mimeType() << ", ";
937 if (pvImg.width() != 0 && pvImg.height() != 0) {
938 std::cout << pvImg.width() << "x" << pvImg.height() << " " << _("pixels") << ", ";
939 }
940 std::cout << pvImg.size() << " " << _("bytes") << ") " << _("to file") << " " << pvPath << std::endl;
941 }
942 auto rc = pvImg.writeFile(pvFile);
943 if (rc == 0) {
944 std::cerr << path_ << ": " << _("Image does not have preview") << " " << num << "\n";
945 }
946}
947
948Task::UniquePtr Extract::clone() const {
949 return std::make_unique<Extract>(*this);

Callers

nothing calls this directly

Calls 8

newFilePathFunction · 0.85
dontOverwriteFunction · 0.85
widthMethod · 0.80
heightMethod · 0.80
extensionMethod · 0.45
mimeTypeMethod · 0.45
sizeMethod · 0.45
writeFileMethod · 0.45

Tested by

no test coverage detected