Lines Matching defs:image

58  * Handles the saving of image meta data
143 * Display the form to edit image meta data
661 if (str_starts_with($mime, 'image/')) {
663 if ($mime == 'image/gif' && $info[2] != 1) {
665 } elseif ($mime == 'image/jpeg' && $info[2] != 2) {
667 } elseif ($mime == 'image/png' && $info[2] != 3) {
800 * @param string $image filename of the current image
803 function media_tabs_details($image, $selected_tab = '')
813 [, $mime] = mimetype($image);
814 if ($mime == 'image/jpeg' && file_exists(mediaFN($image))) {
1004 * @param string $image media id
1009 function media_tab_view($image, $ns, $auth = null, $rev = '')
1014 if ($image && $auth >= AUTH_READ) {
1015 $meta = new JpegMeta(mediaFN($image, $rev));
1016 media_preview($image, $auth, $rev, $meta);
1017 media_preview_buttons($image, $auth, $rev);
1018 media_details($image, $auth, $rev, $meta);
1029 * @param string $image media id
1033 function media_tab_edit($image, $ns, $auth = null)
1037 if ($image) {
1038 [, $mime] = mimetype($image);
1039 if ($mime == 'image/jpeg') media_metaform($image, $auth);
1048 * @param string $image media id
1052 function media_tab_history($image, $ns, $auth = null)
1060 if ($auth >= AUTH_READ && $image) {
1062 (new MediaDiff($image))->show(); //media_diff($image, $ns, $auth);
1065 (new MediaRevisions($image))->show($first);
1075 * @param string $image media id
1082 function media_preview($image, $auth, $rev = '', $meta = false)
1085 $size = media_image_preview_size($image, $rev, $meta);
1089 echo '<div class="image">';
1095 $t = @filemtime(mediaFN($image));
1101 $src = ml($image, $more);
1116 * @param string $image media id
1120 function media_preview_buttons($image, $auth, $rev = '')
1126 if ($auth >= AUTH_DELETE && !$rev && file_exists(mediaFN($image))) {
1130 'action' => media_managerURL(['delete' => $image], '&'),
1145 'action' => media_managerURL(['image' => $image, 'mediado' => 'update'], '&'),
1155 if ($auth >= AUTH_UPLOAD && $rev && $conf['mediarevisions'] && file_exists(mediaFN($image, $rev))) {
1159 'action' => media_managerURL(['image' => $image], '&'),
1175 * Returns image width and height for mediamanager preview panel
1178 * @param string $image
1184 function media_image_preview_size($image, $rev, $meta = false, $size = 500)
1187 !preg_match("/\.(jpe?g|gif|png)$/", $image)
1188 || !file_exists($filename = mediaFN($image, $rev))
1204 * Returns the requested EXIF/IPTC tag from the image meta
1258 * @param string $image image id
1261 * @param bool|JpegMeta $meta image object, or create one if false
1263 function media_details($image, $auth, $rev = '', $meta = false)
1267 if (!$meta) $meta = new JpegMeta(mediaFN($image, $rev));
1283 $media_usage = ft_mediause($image, true);
1299 * @param string $image image id
1306 function media_diff($image, $ns, $auth, $fromajax = false)
1324 * Shows difference between two revisions of image
1328 * @param string $image
1336 function media_file_diff($image, $l_rev, $r_rev, $ns, $auth, $fromajax)
1347 * @param string $image image id
1355 function media_image_diff($image, $l_rev, $r_rev, $l_size, $r_size, $type)
1363 * @param string $image media id
1370 function media_restore($image, $rev, $auth)
1374 $removed = (!file_exists(mediaFN($image)) && file_exists(mediaMetaFN($image, '.changes')));
1375 if (!$image || (!file_exists(mediaFN($image)) && !$removed)) return false;
1376 if (!$rev || !file_exists(mediaFN($image, $rev))) return false;
1377 [, $imime, ] = mimetype($image);
1379 mediaFN($image, $rev),
1380 mediaFN($image),
1381 $image,
1511 $media_manager_params = ['tab_files', 'tab_details', 'image', 'ns', 'list', 'sort'];
1521 unset($gets['image']);
1556 $id = cleanID($INPUT->str('image'));
1772 // TODO: only deliver an image if it actually has a subtree...
1778 * Resizes or crop the given image to the given size
1821 * Resizes the given image to the given size
1837 * Center crops the given image to the wanted size
1859 * @param string $id id of the image
1923 * Download image files
1939 $http->header_regexp = '!\r\nContent-Type: image/(jpe?g|gif|png)!i';
1951 // check if it is really an image
2064 // create an image of the given filetype
2065 $image = false;
2068 $image = @imagecreatefromjpeg($from);
2071 $image = @imagecreatefrompng($from);
2074 $image = @imagecreatefromgif($from);
2076 if (!$image) return false;
2084 imagedestroy($image);
2097 $transcolorindex = @imagecolortransparent($image);
2099 $transcolor = @imagecolorsforindex($image, $transcolorindex);
2120 if (!@imagecopyresampled($newimg, $image, 0, 0, $ofs_x, $ofs_y, $to_w, $to_h, $from_w, $from_h)) {
2121 imagecopyresized($newimg, $image, 0, 0, $ofs_x, $ofs_y, $to_w, $to_h, $from_w, $from_h);
2124 imagecopyresized($newimg, $image, 0, 0, $ofs_x, $ofs_y, $to_w, $to_h, $from_w, $from_h);
2148 // destroy GD image resources
2149 imagedestroy($image);