Skip to content

Commit

Permalink
Merge pull request #15024 from ckeditor/ck/15010-image-guide-update
Browse files Browse the repository at this point in the history
Docs: adding width and height info yo image guide. Closes: #15010
  • Loading branch information
godai78 authored Sep 21, 2023
2 parents fa35555 + 2c2f90c commit a11b794
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ckeditor5-ckbox/docs/features/ckbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ As a full-fledged file manager, CKBox also replaces the basic CKEditor 5 im

With CKBox you no longer need to write server-side code to upload and scale images or manage uploaded files.

To find out more about CKBox, the brand-new file manager, visit the [CKBox website](https://ckeditor.com/ckbox/) and read the dedicated [CKBox documentation page](https://ckeditor.com/docs/ckbox/latest/guides/index.html).
To find out more about CKBox, the brand-new file manager and image editor, visit the [CKBox website](https://ckeditor.com/ckbox/) and read the dedicated [CKBox documentation page](https://ckeditor.com/docs/ckbox/latest/guides/index.html).

## Demo

Expand Down
11 changes: 10 additions & 1 deletion packages/ckeditor5-image/docs/features/images-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ To see all the image features in action, check out the demo below. To learn more
This demo only presents a limited set of features. Visit the {@link examples/builds/full-featured-editor feature-rich editor example} to see more in action.
</info-box>


## Base image feature

The base image feature does not support any user interface for inserting or managing images. Its sole purpose is to lay ground for other plugins (listed below) to build the target user experience. This pattern (composition of atomic features) is common for CKEditor&nbsp;5 and allows the developers to build their own customized experience by implementing specific subfeatures differently.
Expand Down Expand Up @@ -205,6 +204,16 @@ Refer to the {@link features/images-installation image installation} guide for m

See the common API of image-related features such as {@link module:image/imagestyle~ImageStyle}, {@link module:image/imageresize~ImageResize}, and {@link module:link/linkimage~LinkImage} to learn more about available image toolbar buttons.

## Image `width` and `height` attributes

Starting with v40.0.0, the image's `width` and `height` attributes are retained by the editor when it is loaded. Upon {@link features/image-upload uploading an image file} or {@link features/images-inserting inserting it} into the editor content, the CKEditor 5 image feature fetches these dimensions from the file. It will also happen on any interaction with the image if the content is preloaded. The editor then adds these properties to the markup, just like the {@link features/images-text-alternative text alternative tag}.

However, if the user uses an upload adapter and the server sends back the uploaded image with the `width` or `height` parameters already set, these existing values are not overwritten.

Adding the image's `width` and `height` attributes is done to ensure that the image dimensions ratio is properly kept when it is styled or aligned and that the image always looks like it should, rather than forcing the image size within the content.

These image properties can be further controlled via CSS styles. If you need to crop, resize, or mirror flip your images, you can use the {@link features/ckbox CKBox asset manager} to achieve that.

## Typing around images

To type before or after an image easily, select the image, then press the Arrow key (<kbd>←</kbd> or <kbd>→</kbd>) once, depending on where you want to add content &ndash; before or after respectively. The image becomes no longer selected and whatever text you type will appear in the desired position.
Expand Down

0 comments on commit a11b794

Please sign in to comment.