"Christopher M. Miles" <numbch...@gmail.com> writes: > Ihor Radchenko <yanta...@gmail.com> writes: > >> "Christopher M. Miles" <numbch...@gmail.com> writes: >> >>>> When I put it on beginning of org document, then preview inline images, >>>> but those global attributes >>>> not affected. The inline images still display in actual image size. I want >>>> to specify image size >>>> under headline properties. Is it possible to do this? >>> >>> I implemented this feature by written a hook. Hope this can be helpful >>> for someone who also has this needs. Here is the code: >> >> This looks useful. >> Would you be interested to write a patch? > > The is the new patch which updated the defcustom variable docstring has > correct description.
Thanks for the patch! Before extending org-cycle functionality, let's first try to sort out subtree-level setting of the image size. In the patch, you are suggesting to use INLINE-IMAGE-WIDTH property. However, if we apply the patch as is, this property will only be useful when calling a single function - `org-display-subtree-with-inline-images'. It is not ideal. If we introduce subtree-level setting for inline image size, it should also work when displaying inline images by other existing means (org-toggle-inline-images). Instead of working around the existing code of `org-display-inline-images' and setting a custom `org-image-actual-width' variable in buffer, it is much better to change `org-display-inline-images' directly. At the end, the patch is not bound to your personal config - feel free to alter the existing Org functions. Similarly, you do not need to do (add-to-list 'org-default-properties "INLINE-IMAGE-WIDTH") Simply change the default value of `org-default-properties'. Finally, it will be more consistent to name the property closer to the variable name: ORG-IMAGE-ACTUAL-WIDTH. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92