Skip to content

Commit 05437fd

Browse files
author
David Arroyo7
committed
php-exif.el, php-gd.el: creation
1 parent 830a528 commit 05437fd

File tree

2 files changed

+264
-0
lines changed

2 files changed

+264
-0
lines changed

php-exif.el

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
;; Copyright (C) 2015 David Arroyo Menéndez
2+
3+
;; Author: David Arroyo Menéndez <[email protected]>
4+
;; Maintainer: David Arroyo Menéndez <[email protected]>
5+
6+
;; This file is free software; you can redistribute it and/or modify
7+
;; it under the terms of the GNU General Public License as published by
8+
;; the Free Software Foundation; either version 3, or (at your option)
9+
;; any later version.
10+
11+
;; This file is distributed in the hope that it will be useful,
12+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
;; GNU General Public License for more details.
15+
16+
;; You should have received a copy of the GNU General Public License
17+
;; along with GNU Emacs; see the file COPYING. If not, write to
18+
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19+
;; Boston, MA 02110-1301 USA,
20+
21+
;; Exif functions
22+
;; http://php.net/manual/en/ref.exif.php
23+
;; file:///usr/share/doc/php-doc/html/ref.exif.html
24+
25+
26+
(define-skeleton php-exif_imagetype
27+
"Insert an exif_imagetype statement. Determine the type of an image"
28+
> "exif_imagetype(" (skeleton-read "Filename? ") ");"
29+
)
30+
31+
(define-skeleton php-exif_read_data
32+
"Insert an exif_read_data. Reads the EXIF headers from JPEG or TIFF"
33+
""
34+
'(setq filename (skeleton-read "Filename? "))
35+
'(setq sections (skeleton-read "Sections? "))
36+
'(setq arrays (skeleton-read "Arrays (TRUE | FALSE)? "))
37+
'(setq thumbnail (skeleton-read "Thumbnail (TRUE | FALSE)? "))
38+
> "exif_read_data(" filename ", " sections ", " arrays ", " thumbnail ");" \n
39+
)
40+
41+
(define-skeleton php-exif_tagname
42+
"Insert an exif_tagname. Get the header name for an index"
43+
""
44+
'(setq index (skeleton-read "Index? "))
45+
> "exif_tagname(" index ");" \n
46+
)
47+
48+
(define-skeleton php-exif_thumbnail
49+
"Insert an exif_thumbnail. Retrieve the embedded thumbnail of a TIFF or JPEG image"
50+
""
51+
'(setq filename (skeleton-read "Filename? "))
52+
'(setq width (skeleton-read "Width? "))
53+
'(setq height (skeleton-read "Height? "))
54+
'(setq imagetype (skeleton-read "Image type? "))
55+
> "exif_thumbnail(" filename ", " width ", " height ", " imagetype ");" \n
56+
)
57+

php-gd.el

+207
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
;; Copyright (C) 2015 David Arroyo Menéndez
2+
3+
;; Author: David Arroyo Menéndez <[email protected]>
4+
;; Maintainer: David Arroyo Menéndez <[email protected]>
5+
6+
;; This file is free software; you can redistribute it and/or modify
7+
;; it under the terms of the GNU General Public License as published by
8+
;; the Free Software Foundation; either version 3, or (at your option)
9+
;; any later version.
10+
11+
;; This file is distributed in the hope that it will be useful,
12+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
;; GNU General Public License for more details.
15+
16+
;; You should have received a copy of the GNU General Public License
17+
;; along with GNU Emacs; see the file COPYING. If not, write to
18+
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19+
;; Boston, MA 02110-1301 USA,
20+
21+
;; GD functions
22+
;; file:///usr/share/doc/php-doc/html/ref.image.html
23+
24+
(define-skeleton php-gd_info
25+
"Insert a gd_info statement. Retrieve information about the currently installed GD library"
26+
""
27+
> "gd_info();" \n
28+
)
29+
30+
(define-skeleton php-getimagesize
31+
"Insert a getimagesize statement."
32+
""
33+
'(setq filename (skeleton-read "Filename? "))
34+
'(setq imageinfo (skeleton-read "Image info? "))
35+
> "getimagesize(" filename ", " imageinfo ");" \n
36+
)
37+
38+
(define-skeleton php-getimagesizefromstring
39+
"Insert a getimagesizefromstring statement."
40+
""
41+
'(setq imagedata (skeleton-read "Image data? "))
42+
'(setq imageinfo (skeleton-read "Image info? "))
43+
> "getimagesizefromstring(" imagedata ", " imageinfo ");" \n
44+
)
45+
46+
(define-skeleton php-image_type_to_extension
47+
"Insert an image_type_to_extension statement. Get file extension for image type"
48+
""
49+
'(setq imagetype (skeleton-read "Image type?"))
50+
'(setq include_dot (skeleton-read "Include dot to the extension (TRUE | FALSE)"))
51+
> "image_type_to_extension(" imagetype ", " include_dot ");" \n
52+
)
53+
54+
(define-skeleton php-image_type_to_mime_type
55+
"Insert an image_type_to_mime_type statement"
56+
""
57+
'(setq imagetype (skeleton-read "Image type?"))
58+
> "image_type_to_mime_type(" imagetype ");" \n
59+
)
60+
61+
(define-skeleton php-image2wbmp
62+
"Insert an image2wbmp statement. Output image to browser or file"
63+
""
64+
'(setq filename (skeleton-read "Filename? "))
65+
'(setq image (skeleton-read "Image? "))
66+
'(setq treshold (skeleton-read "Treshold? "))
67+
> "image2wbmp(" filename ", " image ", " treshold ");" \n
68+
)
69+
70+
(define-skeleton php-imageaffine
71+
"Insert an imageaffine statement."
72+
""
73+
'(setq image (skeleton-read "Image? "))
74+
'(setq affine (skeleton-read "Affine array? "))
75+
'(setq clip (skeleton-read "Clip? "))
76+
> "imageaffine(" image ", " affine ", " clip ");" \n
77+
)
78+
79+
(define-skeleton php-imageaffinematrixconcat
80+
"Insert an imageaffinematrixconcat statement"
81+
'(setq m1 (skeleton-read "Matrix 1? "))
82+
'(setq m2 (skeleton-read "Matrix 2? "))
83+
> "imageaffinematrixconcat(" m1 ", " m2 ");" \n
84+
)
85+
86+
(define-skeleton php-imageaffinematrixget
87+
"Insert an imageaffinematrixget statement"
88+
'(setq type (skeleton-read "Type? "))
89+
'(setq options (skeleton-read "Options? "))
90+
> "imageaffinematrixget(" m1 ", " m2 ");" \n
91+
)
92+
93+
(define-skeleton php-imagealphablending
94+
"Insert an imagealphablending statement"
95+
""
96+
'(setq image (skeleton-read "Image? "))
97+
'(setq blendmode (skeleton-read "Blendmode? (TRUE | FALSE)"))
98+
> "imagealphablending(" image ", " blendmode ");" \n
99+
)
100+
101+
(define-skeleton php-imageantialias
102+
"Insert an imageantialias statement. Should antialias functions be used or not"
103+
""
104+
'(setq image (skeleton-read "Image? "))
105+
'(setq enabled (skeleton-read "Enabled? (true | false) "))
106+
> "imageantialias(" image ", " enabled ");" \n
107+
)
108+
109+
(define-skeleton php-imagearc
110+
"Insert an imagearc statement"
111+
""
112+
'(setq image (skeleton-read "Image: "))
113+
'(setq cx (skeleton-read "x-coordinate of the center: "))
114+
'(setq cy (skeleton-read "y-coordinate of the center: "))
115+
'(setq width (skeleton-read "width: "))
116+
'(setq height (skeleton-read "height: "))
117+
'(setq start (skeleton-read "start: "))
118+
'(setq end (skeleton-read "end: "))
119+
'(setq color (skeleton-read "color: "))
120+
> "imagearc(" image ", " cx ", " cy ", " width ", " height ", " start ", " end ", " color ");" \n
121+
)
122+
123+
(define-skeleton php-imagechar
124+
"Insert an imagechar statement"
125+
""
126+
'(setq image (skeleton-read "Image: "))
127+
'(setq font (skeleton-read "Font: "))
128+
'(setq x (skeleton-read "x: "))
129+
'(setq y (skeleton-read "y: "))
130+
'(setq c (skeleton-read "c: "))
131+
'(setq color (skeleton-read "color: "))
132+
> "imagechar(" image ", " font ", " x ", " y ", " c ", " color ");" \n
133+
)
134+
135+
(define-skeleton php-imagecharup
136+
"Insert an imagecharup statement"
137+
""
138+
'(setq image (skeleton-read "Image: "))
139+
'(setq font (skeleton-read "Font: "))
140+
'(setq x (skeleton-read "x: "))
141+
'(setq y (skeleton-read "y: "))
142+
'(setq c (skeleton-read "c: "))
143+
'(setq color (skeleton-read "color: "))
144+
> "imagecharup(" image ", " font ", " x ", " y ", " c ", " color ");" \n
145+
)
146+
147+
(define-skeleton php-imagecolorallocate
148+
"Insert an imagecolorallocate statement"
149+
""
150+
'(setq image (skeleton-read "Image: "))
151+
'(setq red (skeleton-read "Red: "))
152+
'(setq green (skeleton-read "Green: "))
153+
'(setq blue (skeleton-read "Blue: "))
154+
> "imagecolorallocate(" image ", " red ", " green ", " blue ");" \n
155+
)
156+
157+
(define-skeleton php-imagecolorallocatealpha
158+
"Insert an imagecolorallocatealpha statement"
159+
""
160+
'(setq image (skeleton-read "Image: "))
161+
'(setq red (skeleton-read "Red: "))
162+
'(setq green (skeleton-read "Green: "))
163+
'(setq blue (skeleton-read "Blue: "))
164+
'(setq alpha (skeleton-read "Alpha: "))
165+
> "imagecolorallocatealpha(" image ", " red ", " green ", " blue ", " alpha ");" \n
166+
)
167+
168+
(define-skeleton php-imagecolorat
169+
"Insert an imagecolorat statement"
170+
""
171+
'(setq image (skeleton-read "Image: "))
172+
'(setq x (skeleton-read "x: "))
173+
'(setq y (skeleton-read "y: "))
174+
> "imagecolorat(" image ", " x ", " y ");" \n
175+
)
176+
177+
(define-skeleton php-imagecolorclosest
178+
"Insert an imagecolorclosest statement. Get the index of the closest color to the specified color"
179+
""
180+
'(setq image (skeleton-read "Image: "))
181+
'(setq red (skeleton-read "Red: "))
182+
'(setq green (skeleton-read "Green: "))
183+
'(setq blue (skeleton-read "Blue: "))
184+
> "imagecolorclosest(" image ", " red ", " green ", " blue ");" \n
185+
)
186+
187+
(define-skeleton php-imagecolorclosestalpha
188+
"Insert an imagecolorclosest statement. Get the index of the closest color to the specified color"
189+
""
190+
'(setq image (skeleton-read "Image: "))
191+
'(setq red (skeleton-read "Red: "))
192+
'(setq green (skeleton-read "Green: "))
193+
'(setq blue (skeleton-read "Blue: "))
194+
'(setq alpha (skeleton-read "Alpha: "))
195+
> "imagecolorclosestalpha(" image ", " red ", " green ", " blue ", " alpha ");" \n
196+
)
197+
198+
(define-skeleton php-imagecolorclosesthwb
199+
"Insert an imagecolorclosesthwb statement. Get the index of the closest color to the specified color"
200+
""
201+
'(setq image (skeleton-read "Image: "))
202+
'(setq red (skeleton-read "Red: "))
203+
'(setq green (skeleton-read "Green: "))
204+
'(setq blue (skeleton-read "Blue: "))
205+
> "imagecolorclosestalpha(" image ", " red ", " green ", " blue ");" \n
206+
)
207+

0 commit comments

Comments
 (0)