Jump to content

midora

Members
  • Posts

    1,535
  • Joined

  • Last visited

  • Days Won

    19

Posts posted by midora

  1. Maybe the issue is related to this comment:

     

    An implementation of this interface for photo thumbnails is supplied in Microsoft Windows as CLSID_PhotoThumbnailProvider. Applications that use the supplied implementation must define a constant CLSID identifier using the GUID {C7657C4A-9F68-40fa-A4DF-96BC08EB3551}.

     

     

  2. We know the documentation of these COM interfaces is limited. .NET 4.0 is needed to implement the interfaces in c#.

    I didn't expect that a lot of people are experienced with this. But you never know.

     

    The handler uses COM IThumbnailProvider and returns BGRA (or you couldn't see through 😉

    No idea what's going on there. Just the standard image format thumbnails are showing the shadow AND .pdn.

    It's for sure not important but I really like to understand what's going on.

    In the moment the code for .bmrl draws the image a little bit higher into the bitmap just to reduce the missing shadow offset effect.

    This way the top line of the images in all the thumbnails is adjusted (otherwise the .bmrl thumbnails would sit a bit deeper).

    This seems to work for all thumbnail sizes.

     

    In the moment I'm creating a InfoTipHandler to show some properties of .bmrl files.

     

    Maybe paint.net could add one to show the dimensions of the image.

     

  3.  Sorry the ReadMe file in the shellextensions zip was empty. Which makes it a bit difficult to install the dlls 😞

     

    So here is a new zip WITH installation guide.

     

    bmp+bmrl.thumbnail.shellextension.zip

     

    Before installation (.bmrl already assigned to open with paint.net)

     

    1900869739_XDropShadowThumbnails-2AlwaysOpenWithPaint_net.thumb.png.3f0c2d92b0e423bb7c3166f3ba4a1667.png

     

    After installation

     

    900747822_XDropShadowThumbnails-3AfterRegistration.thumb.png.52bc7eb6af00bf401e8d04d279c52424.png

    .bmps containing athe BMRL format are showing RL in the top left corners. And .bmrl files the image plus the associated application.

     

    • Like 1
  4. The files with extension .bmp and .bmrl are using my new shell extension to create the thumbnails.

    The 'DropShadow bmrl.bmp' file ist just a renamed copy of the 'DropShadow.bmrl' which I saved from paint.net with the bmrl filetype plugin.

    This 'DropShadow bmrl.bmp' is just to show that thumbnails for files with .bmp extension but .bmrl content are showing now a thumbnail. This is not the case without the shell extension for .bmp because Windos detects these .bmp not as bitmap files.

     

    412463290_DropShadowThumbnails.png.8e68a004684a8ebf29224d98e320dcc3.png

    Same effect in Windows light mode.

    So the question is, how does Windows know that .pdn should get a drop shadow but not .bmrl (latest Windows 10).

     

  5. I'm wondering why the thumbnail of a .pdn file shows a drop shadow in FileExplorer icon views (or the preview panel).

    Typically just .bmps are showing the drop shadow and no other file types (on my Windows 10 laptop).

    Any idea/hint why this is the case for .pdn files? I would like to get it for .bmrl.

    I can not imagine that the drop shadow is part of the thumbnail. Because it uses exact the same colors as .bmps in dark and light mode.

    Does it depend on the type of registration?

     

  6. I created shell extensions to show thumbnails of .bmrl files and .bmp files (containing bmrl) in the Windows FileExplorer.

     

    (removed .zip)

     

    First time I did it in c# (based on a project on github, see readme). Astonishing that this works 😉

     

    Maybe it would make sense to add a RL Marker to the .bmp thumbnails so that users already know that they can't be opened easily in a image processing tool.

     

     

    • Like 1
  7. You should really use the project file proposed by @toe_head2001

    It contains all standard references you typically need in en effect plugin.

    A resource file can be added via the properties of the project. There you can add icons and more. This will also create the right namespace you can reference in your source.

    Start the project from scratch add the required features and export it as template.

    Don't mix references. Use net 5.0.

    • Upvote 1
  8. This version of the plugin allows to save as .bmrl.

    There is a restriction in the amount of colors which can be handled (Not more than 251 different RGBAs in a row).

    The reason is that in this case a quantizer has to be called. But this a little bit special if you are working in a 16-bit 565 color space with 5-bit alpha.

    The source calls WuQuantizer16() to do the job. But this source is not included. If the source is available I would use this one.

    We may also quantize the BGRA image to 256 colors first. But not now. Typically icons are small enough that there is no issue with the code.

    Some png test images should be created to stress the save method.

     

     

     

     

     

     

    • Like 1
  9. 14 minutes ago, AndrewDavid said:

    Keep in mind - If you say they are obsolete - deleting them creates more errors. Best to see it by downloading the repository.

    Obsolete just means you have to use an other variant and not just to remove something.

     

    EffectFlags.Configurable => new EffectOptions() { Flags = EffectFlags.Configurable }

  10. 3 hours ago, Rick Brewster said:

    Fixed a crash when trying to save an image that does not support loading

    Verified 😉 Still I would prefer not to get a preview at all in this case instead a text like "No preview available". In the moment there is again the original image visible which shows transparency.

    • Like 1
  11. 6 hours ago, Rick Brewster said:

    4.3 can't be installed in parallel, but you can use the portable version to achieve what you're thinking of.

    OK, I replaced installed with used in the sentence above. Just if someone is confused about how a portable version can be installed.

    • Like 1
  12. 6 hours ago, AndrewDavid said:

    Because the template was originally designed in 3.5 , that file is in a totally different format. Any changes to it crashes the whole project.

    But thanks for trying

     

    I would then start with a fresh one and add the code to this. It's much more difficult to adapt old ones.

     

     

     

     

     

  13. First to say, I have no experience using VS 2022 Preview but there may be no difference to VS 2019 which I'm using.

     

    You can right click your project in the SolutionExplorer and select 'Edit Project File'. Save will then adapt your dependencies.

     

    What's the content of you project file? Does it contain the following PropertyGroup?

      <PropertyGroup>
        <TargetFramework>net5.0-windows</TargetFramework>
        <UseWindowsForms>true</UseWindowsForms>
      </PropertyGroup>

    This will add Microsoft.WindowsDesktop.App.WindowsForms to Dependencies->FrameWorks

     

    You should also see the references to the paint.net dlls there. I.e.

      <ItemGroup>
        <Reference Include="PaintDotNet.Base">
          <HintPath>..\..\..\..\Users\YOUR LOGIN NAME\Downloads\paint.net.4.300.7918.1291.portable.x64.scd.aot\PaintDotNet.Base.dll</HintPath>
        </Reference>
        <Reference Include="PaintDotNet.Core">
          <HintPath>..\..\..\..\Users\YOUR LOGIN NAME\Downloads\paint.net.4.300.7918.1291.portable.x64.scd.aot\PaintDotNet.Core.dll</HintPath>
        </Reference>
        <Reference Include="PaintDotNet.Data">
          <HintPath>..\..\..\..\Users\YOUR LOGIN NAME\Downloads\paint.net.4.300.7918.1291.portable.x64.scd.aot\PaintDotNet.Data.dll</HintPath>
        </Reference>
      </ItemGroup>

    You may change the relative references to fixed ones (to avoid problems if you are moving the project folder).

     

     

  14. Load and Save should respect the plugin associated to a file type selector in the open/save dialog box.

     

    I'm sure this has been asked before but I couldn't find it.

    And maybe I'm wrong and there is a misunderstanding how the things are working.

     

    In the moment the file type selector is just used to filter the view against the extensions defined in the selector.

    But the associated plugin is not used to execute the operation. Instead the extension determines which plugin or built-in function will be executed.

     

    This makes it difficult to add different .gif loaders or to load files with a somehow bad extension. I.e. these BMPs which are not Windows BMPs.

    Even if we are using a different extension like .bmrl in the selector, the selector would not be respected if we type *.bmp in the filename box and select a bmp file.

     

    Users may be confused if they are not selecting a specific file type selector in the dialog and the application uses the default loader/saver.

    I agree, but it also doesn't satisfy users in all cases.

     

  15. Let's discuss here issues regarding the development of an .bmrl filetype plugin.

     

    There are .bmp files out there which do not contain Windows bitmap files. The signature is "RL" instead of "BM". Standard Windows viewers are not able to open these kind of .bmp files.

    The content of the the files is a run-length endcoded 8-bit indexed format which allows multiple palettes and an alpha channel.

    These files are used for iGO POI icons.

     

    We are not able to enhance or replace the built-in .bmp loader/saver so we have to choose a different filename extension and the user has to change the extension if she likes to edit the file in paint.net. My favorite extension is - in the moment - .bmrl . Because you just have to change the p to rl ,-)

     

    There seems to be no official specification describing the format. But we got a kind of reference implementation in c (open source).

     

    To implement load in c# is easy enough. Save is more tricky because standard color quantization does not respect an alpha channel . There are ideas how this can be done (if the reference implementation is not sufficient).

     

    Comments are welcome.

     

    • Like 1
  16. 15 minutes ago, Rick Brewster said:

    The old FileType.Quantize() method was rebuilt to use the new quantization implementation, so there's that at least. That was in 4.2.16, IIRC. It's not as complete since it doesn't offer all the same options.

     

    That's fine. I must have used in the .a.gif plugin.

    I agree that quantization using alpha is special. In the moment I have no idea how to do it best.

    To get octree in the future is a prospect 😉

     

  17. Maybe I missed the info.

    Is it possible to access octree quantization from a filetype plugin in 4.30?

    A snippet for the usage would be fine.

    And is it possible to include the alpha channel into the quantization process to get a colortable containing ARGB values?

  18. Are you sure that the top line of the logo is a segment of a circle with the tip at the center? If you ere measuring the distance from the tip to the top line then the distance is different at the middle and the outer point. What's the goal? Should the top line be a segment of a perfect circle then you may have to fake it a bit.

×
×
  • Create New...