Git Product home page Git Product logo

chrdavis / pifshellextensions Goto Github PK

View Code? Open in Web Editor NEW
30.0 5.0 8.0 48.61 MB

Windows Shell extension to allow image types such as Portable Pixmap Format (PPM), Portable Graymap Format (PGM) and Portable Bitmap Format (PBM) to get thumbnail, properties and data object support in Windows Explorer. Both ascii and binary versions of the above formats are supported. This extension will render thumbnails and properties (width, height, dimensions, bit depth) which will display in Windows Explorer. It also implements a data handler extension which will permit copying the file from Explorer and pasting in applications such as MSPaint or Photoshop.

Home Page: https://chrdavis.github.io/PIFShellExtensions/

License: MIT License

C++ 55.27% C 2.44% HTML 42.30%
cpp windows-shell windows-explorer shell-extension image-format pbm ppm pgm thumbnails windows

pifshellextensions's Introduction

Windows Shell extension to allow image types such as Portable Pixmap Format (PPM), Portable Graymap Format (PGM) and Portable Bitmap Format (PBM) to get thumbnail, properties and data object support in Windows Explorer. Both ascii and binary versions of the above formats are supported. This extension will render thumbnails and properties (width, height, dimensions, bit depth) which will display in Windows Explorer. It also implements a data handler extension which will permit copying the file from Explorer and pasting in applications such as MSPaint or Photoshop. For more information about the file formats click here.

If you find this useful, feel free to buy me a coffee!

Donate

Download

Latest 32 and 64 bit versions Windows Vista,7,8,10

You will likely need to restart windows for the extension to be picked up by Windows Explorer.

Screenshots

Image description

What the experience in Windows is without this extension

Image description

pifshellextensions's People

Contributors

chrdavis avatar miikka75 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pifshellextensions's Issues

PPM P3 with max value 65535 has wrong colors

I though normalizing image data to range [0, 255] would help but it didn't:

index 00c4a48..c492ca1 100644
--- a/PIFShellExtensionsLib/PIFParser.cpp
+++ b/PIFShellExtensionsLib/PIFParser.cpp
@@ -12,7 +12,7 @@ const LARGE_INTEGER c_liZero = { 0, 0 };
 CBaseImageParser::CBaseImageParser() :
     m_uWidth(0),
     m_uHeight(0),
-    m_uMaxValue(0),
+    m_uMaxValue(255),
     m_uDataLen(0),
     m_spStream(nullptr),
     m_rgData(nullptr),
@@ -231,7 +231,7 @@ HRESULT CBaseImageParser::ReadAsciiImageData()
                 {
                     char* pCurrNumStart = pAsciiData;
                     char* pCurrNumEnd = pAsciiData;
-
+                    double normalize = 1.0 / 255.0 * m_uMaxValue;
                     while (SUCCEEDED(hr) && pCurrNumStart && *pCurrNumStart != '\0')
                     {
                         // First walk any leading whitespace
@@ -257,7 +257,7 @@ HRESULT CBaseImageParser::ReadAsciiImageData()
                             hr = (static_cast<UINT>(pDataCurr - m_rgData) < m_uDataLen) ? S_OK : E_FAIL;
                             if (SUCCEEDED(hr))
                             {
-                                *pDataCurr = static_cast<BYTE>(atoi(pCurrNumStart));
+                                *pDataCurr = static_cast<BYTE>(atof(pCurrNumStart) * normalize);
                                 // Move our insertion pointer for the data
                                 pDataCurr++;
                             }

Any idea what else could be wrong in showing this image?

Color issues with some pictures

I am seeing incorrect colors in some of the previews. Looks like maybe the channels were switched? I can see that both those pictures are correct in GIMP, yet in windows I observe this:

obrazek

The one on the right is correct. All the pictures are generated by the same code.

Here are the original images:
debug_images.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.