| 928 | } // Extract::writeIccProfile |
| 929 | |
| 930 | void 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 | |
| 948 | Task::UniquePtr Extract::clone() const { |
| 949 | return std::make_unique<Extract>(*this); |
nothing calls this directly
no test coverage detected