Image Scaling

Views: 13,662

Results 121 to 135 of 135
15 Feb 2012, 12:15 AM
#121
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Image Scaling

Next version

  1. GIF support. Not quite there yet as described later.

  2. Compression added to admin

  3. Search by Model/ID

  4. Limit additional images to same type as main image

  5. Delete All added to Image Management

  6. Maximum size used added to images and image_scaler menus

  7. Sharpen. Similar to photoshop unsharpmask. Works well for JPG and PNG but is a problem for GIF

  8. Watermarking. Either text or image or both if you want to go really out there. Either is positioned by 'offset positions' from default position. Ha ha I need to spend some time making a default watermark :-)

  9. A bit of work to the installer. Basically code stuff really but also the core overwrite is handled by backing up the original first before overwriting it so that the install can be rolled back if needed.

  10. Replace main image. Again limited to file type so it does not mess up the additional images.

  11. A few other bits and pieces.

I definitely need to write instructions now. There are just under 30 configuration options :-) But have a play and let me know. It should install on top of an existing version just fine. But as always make sure you are backed up.

I kind of think that I have forgotten something this time so if it doesn't work at all that is why! Just let me know.

Thanks again guys.

Nick
iszent.com

15 Feb 2012, 1:52 PM
#122
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Image Scaling

uploaded to test site with same login if you want to take a look, ill get playing with it when i get home later

thanks
bryan

15 Feb 2012, 9:36 PM
#123
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Image Scaling

having a play at the minute, cant seem to get text watermark to work, image watermarking fine.

so far everything else seems to work, will keep playing and report back

bn

15 Feb 2012, 11:28 PM
#124
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Image Scaling

strange. that was a bit that I was kind of not worried about.

I wonder if it is just because the watermarking is in white and it doesn't show against your backgrounds? That is a bit of a problem. Obviously I need to include another config option for color of text.

Check that for me, by just uploading a solid color image, and see what you get.

Thanks Bryan. Great help as always.

Nick

Nick
iszent.com

16 Feb 2012, 8:46 AM
#125
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Image Scaling

http://catchagrip.co.uk/imagescale/index.php?main_page=product_info&cPath=421&products_id=7130

black image loaded, you can log into test site and check im not doing anything wrong, still no text.

other than that everything seems to work, i think i checked most things but will keep testing.

a couple of things, this maybe sounds stupid but can the watermark image be scaled then merged to give the same effect on all file sizes, if you look at link above and go to product info page image and then the large image the watermarking looks so different, also if an image is missing can a default image be displayed, again scaled to suit requirements

thanks
bryan

16 Feb 2012, 9:22 AM
#126
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Image Scaling

Bryan,

No none of it sounds stupid. I had it scaled originally and then changed it. What size do you think it should be? Should the uploaded watermark be the right size for full size images? The problem I had there is that if someone doesn't use the size-limited large images and uses the original instead then the size of the large image is not set.

I am not sure about the default image. the reason is that a default image will be supplied with the module. If people change that image then that is good. But if for whatever reason that image does not exist, I have worries about replacing it with another image. As a for instance, if their image is accidentally deleted or corrupted then the default image will start popping up on the site when they do not expect it to. I wonder if it is best to just not have watermarking in those conditions.

Or thinking about it maybe it needs to just create a default image that is the site name. Hmmm, that probably works. Just more work!

I'll have a look at the text watermarking but probably won't get to it for a couple of days.

Thanks again

Nick
iszent.com

16 Feb 2012, 10:57 AM
#127
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Image Scaling

i think in image handler it lets you create 3 watrermarks sml med lrg if that makes it easier to code

bn

16 Feb 2012, 11:44 AM
#128
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Image Scaling

No the coding isn't really the problem. More just deciding what starting point to use for the scaling.

The thing is that in many ways I realise that I am firmly moving away from the 'small medium large' approach. Part of this has to do with the fact that in many sites I personally build more than three image sizes are used. And part of it is due to the fact that I kind of think that the osCOmmerce/Zen Cart approach to this is not only dated but a bit 'the wrong way around'. By that I mean that it would make more sense if the original image was the large image and then there were folders for small and medium. At the moment with Zen the images that are stored in the database are actually the small images. Just a bit strange. Not wrong just counter-intuitive for me personally.

Nick
iszent.com

17 Aug 2013, 8:50 AM
#129
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Image Scaling

Any updates on this plugin, as I do quite agree with your sentiment in the last post, i have always found the native zencart way of image handling to put it crudely ###### about face, and most sites i build need more than 3 sizes of image, What is the exact issue with gif handling? very few sites I work on use them but there is always those one or two from some obscure supplier.

Webzings Design
Semi retired from Web Design

20 Aug 2013, 7:00 AM
#130
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Image Scaling

No real updates I am afraid. For a couple of reasons. The first is that a couple of large projects have taken my time in the last year and will continue to do so. The second is just absolute belief that I should not release this formally if I don't have time to support it.

Yes, things I think are difficult about Zen and images are :
-- the way the main image is actually the small one
-- additional images in general. why, oh why, they are not stored in the db and have to be hunted by name
Actually, I think that the way of approaching this is to rewrtie sections of core code but that entails a major re-think and is probably not possible without forking.

The problem with gif is just that transparency is hard to handle. I think that that caused issues with watermarking. It is not insurmountable but needs to be worked through with more time than I actually have.

Nick
iszent.com

27 Dec 2013, 11:24 PM
#131
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Image Scaling

Ok minor question,

where is this variable coming from

$origType

I can't seem to trace back to where it is being set.

Webzings Design
Semi retired from Web Design

28 Dec 2013, 11:17 AM
#132
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Image Scaling

Nigel,
I am away from my desk for a few days. Remind me in a day or two and I will look to see what I have done :-)
Merry Christmas.

Nick
iszent.com

30 Dec 2013, 8:41 AM
#133
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Image Scaling

Set in the code :

// Exceptions - check input file is usable
if (!file_exists($input_file)) {
    return false;
}elseif(!is_readable($input_file)){
    return false;
}elseif(!list($origWidth, $origHeight, $origType) = @getimagesize($input_file)){
    return false;
}

Nick
iszent.com

30 Dec 2013, 6:40 PM
#134
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Image Scaling

Cheers that helped, what I was actually after was what decided gif = 1, jpg = 2, png = 3
which is part of the
getimagesize function

Mainly I have a customer that continually puts up bmps of photos and i want to try speed the site up.

Thanks

Webzings Design
Semi retired from Web Design

30 Dec 2013, 6:52 PM
#135
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Image Scaling

getimagesize is part of the php functions. not sure why the types are given those specific numbers.

I get it about the bmp uploads. Somewhere I have ( and may have posted ) a thing that scales and changes type during the upload process. Basically everything that is uploaded ends up being a jpg of the maximum size. I have clients that always upload huge files so scaling them during upload makes sense and making them into jpg rather than any other format makes sense if you aren't dealing with transparency.

Nick
iszent.com