;ELC   
;;; Compiled
;;; in Emacs version 29.4
;;; with all optimizations.



(byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310%\207" [require svg text-property-search custom-declare-group image-crop nil "Image cropping." :group image] 6)#@90 If non-nil, rotate images by updating Exif data.
If nil, rotate the images "physically".
(defvar image-crop-exif-rotate nil (#$ . 257))
(byte-code "\300\301\302\303\304DD\305\306\307\310\311&\210\300\312\302\303\313DD\314\306\315\310\311&\210\300\316\302\303\317DD\320\306\321\310\311&\210\300\322\302\303\323DD\324\306\325\310\311&\207" [custom-declare-variable image-crop-resize-command funcall function #[0 "\300\207" [("convert" "-resize" "%wx" "-" "%f:-")] 1 #1=""] "List of command and command-line arguments to resize an image.\nThe following `format-spec' elements are allowed in the value:\n\n%w: Width.\n%f: File type to produce." :type (repeat string) :version "29.1" image-crop-cut-command #[0 "\300\207" [("convert" "-draw" "rectangle %l,%t %r,%b" "-fill" "%c" "-" "%f:-")] 1 #1#] "List of command and its command-line arguments to cut a rectangle out of image.\n\nThe following `format-spec' elements are allowed in the value:\n%l: Left.\n%t: Top.\n%r: Right.\n%b: Bottom.\n%c: Color.\n%f: File type to produce." (repeat string) image-crop-crop-command #[0 "\300\207" [("convert" "+repage" "-crop" "%wx%h+%l+%t" "-" "%f:-")] 1 #1#] "List of command and its command-line arguments to crop an image.\n\nThe following `format-spec' elements are allowed in the value:\n%l: Left.\n%t: Top.\n%w: Width.\n%h: Height.\n%f: File type to produce." (repeat string) image-crop-rotate-command #[0 "\300\207" [("convert" "-rotate" "%r" "-" "%f:-")] 1 #1#] "List of command and its command-line arguments to rotate an image.\n\nThe following `format-spec' elements are allowed in the value:\n%r: Rotation (in degrees).\n%f: File type to produce." (repeat string)] 8)#@575 Function to return the buffer text corresponding to the cropped image.
After cropping an image, the displayed image in the buffer will be updated
to show the cropped image.  Different modes will have different ways to
represent this image data in a buffer, but that's up to the mode.  For
instance, an HTML-based mode might want to represent the image with
<img src="data:...base64...">.

The default action is to not alter the image's text in the buffer, and
just return it.

The function is called with two arguments: the original buffer text,
and the cropped image data.
(defvar image-crop-buffer-text-function 'image-crop--default-buffer-text (#$ . 1933))
(byte-code "\300\301\302\303\304DD\305\306\307\310\311&\207" [custom-declare-variable image-cut-color funcall function #[0 "\300\207" ["black"] 1 ""] "Color to use for the rectangle that was cut from the image." :type string :version "29.1"] 8)#@784 Cut a rectangle from the image under point, filling it with COLOR.
COLOR defaults to the value of `image-cut-color'.
Interactively, with prefix argument, prompt for COLOR to use.

This command presents the image with a rectangular area superimposed
on it, and allows moving and resizing the area to define which
part of it to cut.

While moving/resizing the cutting area, the following key bindings
are available:

`q':   Exit without changing anything.
`RET': Crop/cut the image.
`m':   Make mouse movements move the rectangle instead of altering the
       rectangle shape.
`s':   Same as `m', but make the rectangle into a square first.

After cutting the image, you can save it by `M-x image-save' or
\<image-map>\[image-save] when point is over the image.

(fn &optional COLOR)
(defalias 'image-cut #[256 "\301G\302U\203\f \202 !\207" [image-cut-color image-crop 0] 4 (#$ . 2845) (byte-code "\205 \301\302!C\207" [current-prefix-arg read-color "Color to use for filling: "] 2)])#@813 Crop the image under point.
This command presents the image with a rectangular area superimposed
on it, and allows moving and resizing the area to define which
part of it to crop.

While moving/resizing the cropping area, the following key bindings
are available:

`q':   Exit without changing anything.
`RET': Crop/cut the image.
`m':   Make mouse movements move the rectangle instead of altering the
       rectangle shape.
`s':   Same as `m', but make the rectangle into a square first.

After cropping the image, you can save it by `M-x image-save' or
\<image-map>\[image-save] when point is over the image.

When called from Lisp, if CUT is non-nil, remove a rectangle from
the image instead of cropping the image.  In that case, CUT should
be the name of a color to fill the rectangle.

(fn &optional CUT)
(defalias 'image-crop #[256 "\306\307!\204\n \310\311!\210@\312!\211\204 \310\313\"\210	\314>\2039 \315\230\2039 \316\317\320\321\322\n#!\"\323U\2039 \310\324\"\210\266\325 \326!\204G \327\330!\210\331`!\203Q \327\332!\210\333A\334\"\335 \333A\336\"\203k \321\337\333A\336\"\"\202r \205r \340!\341`\342\343\"\344@A\345\346\347\350&\212\351\352\"\211\203\243 \353!\f>\204\235 \354\355\356D\"\210\211\357H\202\244 e)\262\212\360\352	\"\211\203\306 \353!\f>\204\300 \354\355\356D\"\210\211\341H\202\307 d)\262{\343\361\211\362\363\343\"r\211q\210\364\365\"\216\366\361!\210\204\363 \367\333A\370\"!\210\202\367 c\210\361@\371!)\210\372 \262\340!\262\n\373A\374\375\376\377\"A@BD\"\210\372 *\262\f\210\201B \f\343\201C \f@\201D A&\210\201E  ?\205D\201F  p|\210\201G !\210`\262\201H 1x\212\341y\210\201I \203o\201J \202r\201K \")0\202{\361\262\201L \201M \201N !\203\220\201J \202\223\201O \"\210|\210\211\203\262\201P \f&\210\202\271c\210\nb\210\201Q !\262\203\350\201R !\203\350rq\210\201E  \203\347\201F  \232\203\347\201S \361!\210)\266\202*\207" [image-crop-crop-command system-type null-device image-scaling-factor cl-struct-prop-match-tags inhibit-read-only image-type-available-p svg error "SVG support is needed to crop and cut images" executable-find "Couldn't find `%s' command to crop/cut the image" (windows-nt ms-dos) "convert" string-search "Invalid drive specification." shell-command-to-string format "%s %s" 0 "The program `%s' is not an image conversion program" image--get-image imagep user-error "No image under point" overlays-at "Can't edit images that have overlays" cl-getf :data prepare-change-group :format "%s" image-crop--content-type 1 image-size t svg-create :xmlns:xlink "http://www.w3.org/1999/xlink" :stroke-width 5 text-property-search-backward display type-of signal wrong-type-argument prop-match 2 text-property-search-forward nil generate-new-buffer " *temp*" make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte insert-file-contents-literally :file image-crop--possibly-rotate-buffer buffer-string image-crop--process (119 . 600) 102 split-string "/" image-crop-exif-rotate image-crop-resize-command svg-embed :width :height buffer-modified-p buffer-hash svg-insert-image (quit) image-crop--crop-image-1 "cut" "crop" message substitute-command-keys "Type \\[image-save] to save %s image to file" "cropped" image-crop--crop-image-update undo-amalgamate-change-group buffer-live-p restore-buffer-modified-p] 23 (#$ . 3841) nil])#@37 

(fn AREA DATA SIZE TYPE CUT TEXT)
(defalias 'image-crop--crop-image-update #[1542 "\303\304\305\306\307#\307\"\310@!@\245\311\312\313\314\"\313\f\315\"Z_!!\311\312\313\f\316\"\313\317\"Z_!!\312\313\f\315\"\313\314\"^_!\312\313\317\"\313\316\"^_!\320\321\322\307\"r\211q\210\323\324\"\216\325\306!\210\fc\210	\203\231 \326	\327B\330B\331\\B\332\\B\333B\334\335\336\"A@B\257\"\210\202\270 \326\n\327B\330B\337\nB\340\nB\334\335\336\"A@B\257\"\210\341 *\262\")\207" [image-scaling-factor image-crop-cut-command image-crop-crop-command 1 image-size create-image nil t float abs truncate cl-getf :right :left :bottom :top image-crop--insert-image-data generate-new-buffer " *temp*" make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte image-crop--process 108 116 114 98 99 102 split-string "/" 119 104 buffer-string] 25 (#$ . 7274)])#@13 

(fn AREA)
(defalias 'image-crop--width #[257 "\300\301\"\300\302\"Z\207" [plist-get :right :left] 5 (#$ . 8212)])#@13 

(fn AREA)
(defalias 'image-crop--height #[257 "\300\301\"\300\302\"Z\207" [plist-get :bottom :top] 5 (#$ . 8335)])#@15 

(fn SVG OP)
(defalias 'image-crop--crop-image-1 #[514 "\300\301\302#!\207" [internal--track-mouse make-closure #[0 "\302\303\304!\300\"\305\306\307\310\307\311\307\312\307\257\313\211\211\314!\262\315\267\202\216 \316\262\302\317\300\"\262\320!\321!^\322\311\313#A\211\203H \211\323\306\"\\\240\266\202W \311\323\306\"\\BB\262\210\322\312\313#A\211\203o \211\323\310\"\\\240\266\202\371\312\323\310\"\\BB\262\266\202\371\316\262\302\324\300\"\262\202\371:\203\371A@:\203\371\325A@8\203\371\326\325A@8A\327\"\330=\203\371\331A@8\332\267\210\202\371@\333=\203\370\334\262\302\335\300\"\262\211@\336\306#\262\210\211A\336\310#\262\210\211@\336\311#\262\210\211A\336\312#\262\266\202\371@\337=\203\211@\336\311#\262\210\211A\336\312#\262\266\202\371@\340>\203\370\341\262\302\303\342!\300\"\262\210\202\371@\333=\203\370\343\344#\262\203P\345\262\302\303\346!\300\"\262\210\202\371@\347>\203h\341\262\302\350\300\"\262\210\202\371@\337=\203\370@@\336#\262\266A@A\336#\262\266\202\371@\333=\203\370\351\262\302\324\300\"\262\210\202\371@\337=\203\344\211@\320!\\\336\311#\262\210\211@\336\306#\262\210\211A\321!\\\336\312#\262\210\211A\336\310#\262\266\202\371@\352>\203\370\316\262\302\353\300\"\262\210\202\371\210\354\301\326\306\"\326\310\"\320!\321	!\355\356\357\360\361\362\363\364\365\366&\210\367>\204&\313\262\202 \370=\205-\207" [V0 V1 format substitute-command-keys "Select area for %s (click \\`mouse-1' and drag)" begin :left 0 :top :right :bottom nil read-event #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (115 32 109 130)) move-unclick "Move square for %s" image-crop--width image-crop--height plist-member plist-get "Move for %s" 7 cl-getf :type svg 8 #s(hash-table size 6 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (begin 188 stretch 252 corner 307 adjust 340 move-unclick 399 move-click 419)) down-mouse-1 stretch "Stretch to end point for %s" cl--set-getf mouse-movement (mouse-1 drag-mouse-1) corner "Type \\`RET' to %s, or click and drag \\`mouse-1' to adjust corners" image-crop--find-corner ((:left :top) (:left :bottom) (:right :top) (:right :bottom)) adjust "Adjusting %s area (release \\`mouse-1' to confirm)" (mouse drag-mouse-1) "Choose corner to adjust area for %s" move-click (mouse-1 drag-mouse-1) "Click to move for %s" svg-rectangle :stroke-color "red" :stroke-width 2 :fill-opacity 0.3 :fill "black" :id "rect" (return 113) return] 22]] 7 (#$ . 8459)])#@25 

(fn AREA POS CORNERS)
(defalias 'image-crop--find-corner #[771 "\211\300\211\211:\203O @\262\301@\302Z\303	@\"@\302\\#\203D \301A\302Z\303	A@\"A\302\\#\203D \262\300\211\262\202E \304\203O A\262\202 \207" [nil < 10 cl-getf t] 12 (#$ . 11083)])#@14 

(fn IMAGE)
(defalias 'image-crop--content-type #[257 "\300\301\302\"r\211q\210\303\304\"\216\305\306!\210c\210\307ed\310\302p\306\311\312&\210\313\314 !A@*\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil call-process-region "file" "--mime-type" "-" split-string buffer-string] 11 (#$ . 11357)])#@14 

(fn IMAGE)
(defalias 'image-crop--possibly-rotate-buffer #[257 "\303!\205\240 \304\305 !\306\307\"\203\205 \203V \211\310\232\203V \311\312!\203V \313ed\312\314p\315D\315\316\317\320\306\f\307\"!\211\321\267\202I \322\202J \323\202J \324\202J \325\202J \322\262\"\326\327\211&\n\210\202\205 \330	\331\306\307\"B\332\333\334\"A@BD\"\210\211\310\232\203\205 \311\312!\203\205 \313ed\312\314p\315D\315\335\326\327\211&\n\210\306\336\"\205\236 \330\n\337\306\336\"B\332\333\334\"A@BD\"\262\207" [image-crop-exif-rotate image-crop-rotate-command image-crop-resize-command imagep image-crop--content-type buffer-string image-property :rotation "image/jpeg" executable-find "exiftool" call-process-region t nil format "-Orientation#=%d" truncate #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (0 57 90 61 180 65 270 69)) 0 6 3 8 "-o" "-" image-crop--process 114 102 split-string "/" "-Orientation#=0" :width 119] 15 (#$ . 11757)])#@19 

(fn IMAGE TEXT)
(defalias 'image-crop--insert-image-data #[514 "\301\302\303\304\305\306 \307Z\310\311 \312Z&\"\303\211\304%\207" [image-crop-buffer-text-function insert-image create-image nil t :max-width frame-pixel-width 50 :max-height frame-pixel-height 150] 12 (#$ . 12737)])#@91 Use `call-process-region' with COMMAND expanded with EXPANSIONS.

(fn COMMAND EXPANSIONS)
(defalias 'image-crop--process #[514 "\300\301ed\302@\"\303p\304D\304\305\306\307\"A\"&\207" [apply call-process-region format-spec t nil mapcar make-closure #[257 "\301\300\"\207" [V0 format-spec] 4 "\n\n(fn ELEM)"]] 14 (#$ . 13030)])#@19 

(fn TEXT IMAGE)
(defalias 'image-crop--default-buffer-text #[514 "\300!\207" [substring-no-properties] 4 (#$ . 13371)])
(provide 'image-crop)
