当前位置:首页>python>Python零基础入门(九):Pillow图片处理进阶

Python零基础入门(九):Pillow图片处理进阶

  • 2026-07-02 16:29:26
Python零基础入门(九):Pillow图片处理进阶

Python零基础入门(九):Pillow图片处理进阶

上篇搞定了基础操作——打开、保存、缩放、裁剪、旋转、调色。

这篇来点实用的:画文字图形、批量处理图片、做一个证件照生成器

👉 没看过上篇?点这里

一、绘制文字和图形

画基本图形

from PIL import Image, ImageDrawimg = Image.new("RGB", (400, 300), "white")draw = ImageDraw.Draw(img)# 画线:起点、终点、颜色、粗细draw.line([(0, 0), (400, 300)], fill="red", width=3)# 画矩形:左上角、右下角draw.rectangle([(50, 50), (150, 100)], outline="green", width=2)draw.rectangle([(200, 50), (300, 100)], fill="yellow")  # 填充色# 画椭圆draw.ellipse([(50, 150), (150, 200)], outline="purple", width=2)# 画多边形draw.polygon([(200, 220), (250, 280), (300, 220)], fill="pink")img.save("shapes.png")

写文字

from PIL import Image, ImageDraw, ImageFontimg = Image.new("RGB", (400, 200), "white")draw = ImageDraw.Draw(img)# 默认字体(很小,只适合测试)draw.text((50, 50), "Hello, Pillow!", fill="black")# 用自定义字体(中文必须用中文字体文件)try:    font = ImageFont.truetype("C:/Windows/Fonts/msyh.ttc", 36)  # 微软雅黑except:    font = ImageFont.load_default()draw.text((50, 100), "你好,世界!", fill="red", font=font)img.save("text.png")

字体路径参考

  • • Windows:C:/Windows/Fonts/msyh.ttc(微软雅黑)、simhei.ttf(黑体)
  • • Mac:/System/Library/Fonts/PingFang.ttc
  • • Linux:/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf

添加水印

这是实际项目里最常见的需求:

from PIL import Image, ImageDraw, ImageFontdef add_watermark(image_path, text, output_path,                   position="bottom-right", opacity=128):    """    给图片加文字水印    position: top-left, top-right, bottom-left, bottom-right, center    opacity: 透明度 0-255    """    img = Image.open(image_path).convert("RGBA")    # 新建透明图层画水印    watermark = Image.new("RGBA", img.size, (0, 0, 0, 0))    draw = ImageDraw.Draw(watermark)    try:        font = ImageFont.truetype("C:/Windows/Fonts/msyh.ttc", 36)    except:        font = ImageFont.load_default()    # 算文字尺寸    bbox = draw.textbbox((0, 0), text, font=font)    text_w = bbox[2] - bbox[0]    text_h = bbox[3] - bbox[1]    # 算位置    margin = 20    positions = {        "top-left": (margin, margin),        "top-right": (img.width - text_w - margin, margin),        "bottom-left": (margin, img.height - text_h - margin),        "bottom-right": (img.width - text_w - margin, img.height - text_h - margin),        "center": ((img.width - text_w) // 2, (img.height - text_h) // 2),    }    x, y = positions.get(position, positions["bottom-right"])    # 画水印    draw.text((x, y), text, fill=(255, 255, 255, opacity), font=font)    # 合并图层,转回RGB保存    result = Image.alpha_composite(img, watermark)    result.convert("RGB").save(output_path, quality=95)    print(f"水印已添加:{output_path}")# 用法add_watermark("photo.jpg", "© 2024 My Photo", "output.jpg")

二、批量处理

一张一张手动处理?不存在的。写个循环批量搞定。

批量调整尺寸

import osfrom PIL import Imagedef batch_resize(input_dir, output_dir, size=(800, 600)):    os.makedirs(output_dir, exist_ok=True)    for f in os.listdir(input_dir):        if f.lower().endswith(('.jpg', '.jpeg', '.png', '.bmp', '.webp')):            try:                with Image.open(os.path.join(input_dir, f)) as img:                    img.thumbnail(size, Image.Resampling.LANCZOS)                    img.save(os.path.join(output_dir, f), quality=95)                    print(f"✓ {f}")            except Exception as e:                print(f"✗ {f}: {e}")# batch_resize("photos", "photos_resized", (1024, 768))

批量转格式

def batch_convert(input_dir, output_dir, target="PNG"):    os.makedirs(output_dir, exist_ok=True)    for f in os.listdir(input_dir):        if f.lower().endswith(('.jpg', '.jpeg', '.png', '.bmp', '.webp')):            name = os.path.splitext(f)[0]            new_f = f"{name}.{target.lower()}"            try:                img = Image.open(os.path.join(input_dir, f))                if target == "JPEG" and img.mode == "RGBA":                    img = img.convert("RGB")  # JPEG不支持透明                img.save(os.path.join(output_dir, new_f), target)                print(f"✓ {f} → {new_f}")            except Exception as e:                print(f"✗ {f}: {e}")# batch_convert("photos_png", "photos_jpg", "JPEG")

生成缩略图网格

把一堆图片拼成一张预览图,方便查看:

def create_thumbnail_grid(input_dir, output_path, thumb_size=(150, 150), cols=4, padding=10):    files = [f for f in os.listdir(input_dir)             if f.lower().endswith(('.jpg', '.jpeg', '.png', '.bmp', '.webp'))]    if not files:        print("没找到图片")        return    rows = (len(files) + cols - 1) // cols    w = cols * (thumb_size[0] + padding) + padding    h = rows * (thumb_size[1] + padding) + padding    grid = Image.new("RGB", (w, h), (255, 255, 255))    for i, f in enumerate(files):        img = Image.open(os.path.join(input_dir, f))        img.thumbnail(thumb_size, Image.Resampling.LANCZOS)        row, col = i // cols, i % cols        x = padding + col * (thumb_size[0] + padding) + (thumb_size[0] - img.width) // 2        y = padding + row * (thumb_size[1] + padding) + (thumb_size[1] - img.height) // 2        grid.paste(img, (x, y))    grid.save(output_path, quality=95)    print(f"网格已保存:{output_path}")# create_thumbnail_grid("photos", "grid.jpg", cols=5)

三、综合实战:证件照处理器

把前面学的全串起来,做一个实用的证件照工具:

from PIL import Imageimport osclass IDPhotoProcessor:    """证件照处理器"""    # 常用尺寸(300dpi下的像素值)    SIZES = {        "一寸": (295, 413),        "二寸": (413, 579),        "小一寸": (260, 378),        "小二寸": (413, 531),    }    def __init__(self, image_path):        self.original = Image.open(image_path)        self.processed = self.original.copy()    def resize_to_id(self, size_name="一寸"):        """调整为证件照尺寸(等比缩放,居中填充白边)"""        if size_name not in self.SIZES:            raise ValueError(f"不支持:{size_name},可选:{list(self.SIZES.keys())}")        target = self.SIZES[size_name]        # 等比缩放        ratio = min(target[0] / self.processed.width, target[1] / self.processed.height)        new_size = (int(self.processed.width * ratio), int(self.processed.height * ratio))        self.processed = self.processed.resize(new_size, Image.Resampling.LANCZOS)        # 居中放到白色画布上        canvas = Image.new("RGB", target, (255, 255, 255))        x = (target[0] - new_size[0]) // 2        y = (target[1] - new_size[1]) // 2        canvas.paste(self.processed, (x, y))        self.processed = canvas        return self    def add_border(self, width=2, color=(0, 0, 0)):        """加边框"""        w, h = self.processed.size        canvas = Image.new("RGB", (w + 2 * width, h + 2 * width), color)        canvas.paste(self.processed, (width, width))        self.processed = canvas        return self    def create_print_sheet(self, count=8, size_name="一寸"):        """生成A4打印排版"""        self.resize_to_id(size_name)        photo = self.processed.copy()        # A4 300dpi: 2480x3508        a4_w, a4_h = 2480, 3508        pad = 50        cols = (a4_w - pad) // (photo.width + pad)        rows = (a4_h - pad) // (photo.height + pad)        sheet = Image.new("RGB", (a4_w, a4_h), (255, 255, 255))        total_w = cols * (photo.width + pad) - pad        total_h = rows * (photo.height + pad) - pad        x_off = (a4_w - total_w) // 2        y_off = (a4_h - total_h) // 2        placed = 0        for row in range(rows):            for col in range(cols):                if placed >= count:                    break                x = x_off + col * (photo.width + pad)                y = y_off + row * (photo.height + pad)                sheet.paste(photo, (x, y))                placed += 1        return sheet    def save(self, output_path, quality=95):        os.makedirs(os.path.dirname(output_path) or ".", exist_ok=True)        if self.processed.mode == "RGBA":            self.processed = self.processed.convert("RGB")        self.processed.save(output_path, quality=quality)        print(f"已保存:{output_path}")

用法:

# 生成一寸照processor = IDPhotoProcessor("my_photo.jpg")processor.resize_to_id("一寸")processor.save("output/一寸.jpg")# 生成带边框的二寸照processor = IDPhotoProcessor("my_photo.jpg")processor.resize_to_id("二寸").add_border().save("output/二寸_边框.jpg")# 生成A4打印排版processor = IDPhotoProcessor("my_photo.jpg")sheet = processor.create_print_sheet(count=8, size_name="一寸")sheet.save("output/一寸_排版.jpg")

小结

上下两篇加起来,Pillow的核心用法就这些:

场景
关键方法
打开/保存
Image.open()
 / .save()
缩放
resize()
强制尺寸,thumbnail()等比
裁剪
crop((左, 上, 右, 下))
旋转翻转
rotate()
 / transpose()
调色
ImageEnhance
系列
滤镜
ImageFilter
系列
绘制
ImageDraw
画图写字
批量
循环 + 函数封装

日常图片处理需求,Pillow基本都能覆盖。更高级的(人像抠图、目标检测)可以看看OpenCV或深度学习方案。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-02 23:32:21 HTTP/2.0 GET : https://f.mffb.com.cn/a/502817.html
  2. 运行时间 : 0.240452s [ 吞吐率:4.16req/s ] 内存消耗:4,495.52kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=47a9c4b77578c821b8119e90cdca5d75
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000798s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001481s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.006315s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.010454s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001713s ]
  6. SELECT * FROM `set` [ RunTime:0.007043s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001930s ]
  8. SELECT * FROM `article` WHERE `id` = 502817 LIMIT 1 [ RunTime:0.021661s ]
  9. UPDATE `article` SET `lasttime` = 1783006341 WHERE `id` = 502817 [ RunTime:0.016988s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.003779s ]
  11. SELECT * FROM `article` WHERE `id` < 502817 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001156s ]
  12. SELECT * FROM `article` WHERE `id` > 502817 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001085s ]
  13. SELECT * FROM `article` WHERE `id` < 502817 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001846s ]
  14. SELECT * FROM `article` WHERE `id` < 502817 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002492s ]
  15. SELECT * FROM `article` WHERE `id` < 502817 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002781s ]
0.244057s