Topic Closed
a2exfr
240 Posts
21K Downloads
2 Themes
10 Plugins

Need to get real path of page images, to generete a special  sized croped  thumbnail for addon

so there are such type of scr:

1 - src="/data/_uploaded/image/thumbnails/image/portfolio2/1.jpg.jpg

2 - src="/include/image.php?i=a&w=325&h=175&img=%2Fimage%2Fportfolio1%2Fth1.jpg

3 -src="/data/_resized/img_type/CKzWdXuGNl0.1445292440.png"

from 1 and 2 i can get  real image path, parsing scr.

But how to get real path of image from 3 src?

extension is changins to png, coludn't find where it happens.

Any help  to get  real path would be great.

3 years ago#8128

feniweb
297 Posts

Hallo a2exfr

Maybe you can find a solution in line Finder.class.php 1667.

 

3 years ago#8131

juergen
1.3K Posts
46.3K Downloads
16 Plugins
design, web development & visual effects

This is part of a JavaScript/jQuery hack I sometimes use to get the full sized image:

var img = [your jQuery selector];
var imageSrc = img.attr("src");
var imageFullSrc = imageSrc;
if ( imageSrc.indexOf("image.php?") && typeof(imgDirPrefix) != "undefined" && imageSrc.indexOf("http") == false ) {
  imageFullSrc = imgDirPrefix + "/" + decodeURIcomponent( imageSrc.indexOf("&img=") );
}
img.data("fullSrc", imageFullSrc);
var imageWidth  = img.attr("width")  || imageSrc.substring( imageSrc.indexOf("&w=") , imageSrc.indexOf("&h=") );
var imageHeight = img.attr("height") || imageSrc.substring( imageSrc.indexOf("&h=") , imageSrc.indexOf("&img=") );
var imageScaledUp = (imageWidth*2 < $(this).width() || imageHeight*2 < $(this).height());
var showImageSrc = imageScaledUp ? imageFullSrc : imageSrc;

Sorry, quite unfiltered stuff, but it should be relatively easy to translate into PHP if you want it on the server side.
The most relevant part is decodeURIcomponent( imageSrc.indexOf("&img=") )

Could well be there is an easier way, though.

 

Edit: OOPS, sorry, I didn't read your post carefully. Don't know, sorry.

Edited: 3 years ago#8135

a2exfr
240 Posts
21K Downloads
2 Themes
10 Plugins

Thanks.

It's a parser for  this type of scr

src="/include/image.php?i=a&w=325&h=175&img=%2Fimage%2Fportfolio1%2Fth1.jpg

this I can handle.

but for images that come from new in gp4.5 image section?(

src="/data/_resized/img_type/CKzWdXuGNl0.1445292440.png"

CKzWdXuGNl0 - it's a image name, but where is the rest stored

3 years ago#8136

juergen
1.3K Posts
46.3K Downloads
16 Plugins
design, web development & visual effects
Hmm, unfortunately - as far as I can see - there is no reference for this kind of image-section-images stored anywhere.
3 years ago#8137

juergen
1.3K Posts
46.3K Downloads
16 Plugins
design, web development & visual effects

The image data is created in /include/tool/editing.php

It would be possible to add

$source_file_rel_orig = $source_file_rel;

in line 930 and then

$section['attributes']['orig_src'] = $source_file_rel_orig;

around line 970.

Since 4.6 alpha has (yet unofficially) started, fork gpEasy and make a pull request.

 

 

3 years ago#8138

Topic Closed

 

News

Typesetter 5.1
8/12/2017

Typesetter 5.0.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... Read More

More News

Communics Online Agency

Online agency based in the Netherlands. We create websites that focus on purpose and conversion. We follow UX & web standards so your visitors get the best website experience.

Find out more about our Provider Spotlight

Log In

  Register